Made a simple shift to sprint, wanting to make the players FOV change when they engage and disengage sprinting. Here's my code
--player
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:wait()
local human = char:WaitForChild("Humanoid")
--camera
local cam = game.Workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Scriptable
human:GetPropertyChangedSignal("WalkSpeed"):connect(function()
if human.WalkSpeed == 24 and cam.FieldOfView < 90 then
while cam.FieldOfView < 90 do
cam.FieldOfView = cam.FieldOfView + 2
wait()
end
end
if human.WalkSpeed == 16 and cam.FieldOfView > 70 then
while cam.FieldOfView > 70 do
cam.FieldOfView = cam.FieldOfView - 2
end
end
end)
it produces this result: https://gyazo.com/3cbaf487456cc44c2e2044d507fa7cc7
Any ideas of how to stop it not being connected to the player? Also, the script doesn't go through the second while loop, when the FOV is greater than 70, help would be appreciated.

2 comments
i'm pretty sure it's because of 'cam.CameraType = Enum.CameraType.Scriptable' but you can't simply remove it
You can change FOV without setting the camera type to Scriptable