I'm trying to set the camera's Field of View value to either one of those, but I just can't seem to get it to work. It returns an error of:
Error running Lua task: [725479BC440F02AA] NewScript:15: attempt to index a nil value (upvalue 'propCamera')
Here is the entire script"
local propCamera = script.Parent
function OnBindingPressed(whichPlayer, binding)
if (binding == "ability_extra_1") then
propCamera.fieldOfView = 10
end
if (binding == "ability_extra_2") then
propCamera.fieldOfView = 50
end
if (binding == "ability_extra_3") then
propCamera.fieldOfView = 90
end
end
function OnPlayerJoined(player)
player.bindingPressedEvent:Connect(OnBindingPressed)
end
Game.playerJoinedEvent:Connect(OnPlayerJoined)