I can't seem to find the errors in my sprinting script, can someone help?
game:GetService("UserInputService").InputBegan:connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.LeftShift then
for i = 1,16 do
wait ()
game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView + 1.6
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + 1
end
end
end)
game:GetService("UserInputService").InputEnded:connect(function(input,gameprocessed)
if input.KeyCode == Enum.KeyCode.LeftShift then
for i = 1,16 do
wait ()
game.Workspace.CurrentCamera.FieldOfView = game.Workspace.CurrentCamera.FieldOfView - 1.6
game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - 1
end
end
end)