Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I can't seem to find the errors in my sprinting script, can someone help?

Asked by
Kqntix 7
5 years ago
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)
0
connect() is deprecated. That's the problem. Use Connect(). DeceptiveCaster 3761 — 5y
0
whats the error? ieatandisbaconhair 77 — 5y
0
connect is deprecated so I suggest switch to Connect. And use variables so you don't have to constantly say LocalPlayer. User#19524 175 — 5y
1
Can you specify exactly what your error(s) is/are? Help us so we can help you. RAYAN1565 691 — 5y

Answer this question