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

I tried to make a control to sprint script but doesn't work, what I did wrong?

Asked by
boyoss 2
3 years ago

Here's the script:


local UserInputService = game:GetService("UserInputService")) local currWalkSpeed = 10 UserInputService.InputBegan:connect(function(key) if key.KeyCode == Enum.KeyCode.LeftControl then if currWalkSpeed == 10 then currWalkSpeed = 20 else currWalkSpeed = 10 end game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = currWalkSpeed end end)
0
What happens when you press control? Any errors in the console? check if the event even runs: just place a print statement into the function and check if it prints something when you press a button. Jonix151 65 — 3y
0
I placed a print and nothing happened boyoss 2 — 3y

Answer this question