I want to make it so the fov won't change when the tool is unequipped, the current script doesn't work, here is my script:
--The whole script doesn't work but if I remove this it works but still does it even if you unequip the tool:
--if tool.Unequipped then
--camera.FieldOfView = 70
local mouse = game.Players.LocalPlayer:GetMouse()
local camera = game.Workspace.CurrentCamera
local tool = script.Parent
mouse.Button2Down:Connect(function() --When you rightclick the fov changes
camera.FieldOfView = 40
if tool.Unequipped then --But if it is unequipped it won't change the fov so it stays at 70 (Doesn't work)
camera.FieldOfView = 70
end
end)
mouse.Button2Up:Connect(function() --When you release the right click it will go back to 70
camera.FieldOfView = 70
end)
This script is being used for a gun I made

1 comment
Thanks i'll see if that works