✓ Accepted answer
If you're just trying to change the FieldOfView, use this:
script.Parent.Equipped:connect(function()
workspace.CurrentCamera.FieldOfView = Put what FOV you want here
end)
Change script.Parent to script.Parent.Parent if you put the script in the tool's handle.
If you're not familiar with the Equipped event, you can find it here: http://wiki.roblox.com/index.php?title=API:Class/Tool/Equipped
If you want to change the FOV when they unequip the tool, just take the function and change Equipped to Unequipped and set the FOV to whatever you want it to be when the tool is unequipped.
Also in line 3, you can't use playr.head because you're inside of the player not the player's character. To get the character, all you have to do is use playr.Character. In lines 6 and 7, if you want to change the game's default min and max zoom distance, you can change them in StarterPlayer. There's a section named Camera.
1 comment
thanks