Basically a sprint system. No output errors just nothing happens, anyone know whats wrong? Any help is appreciated and here's the code:
player = script.Parent.Parent
character = player.Character
local sprinting = false
function onKeyPress(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
if sprinting == false then
sprinting = true
character.Humanoid.WalkSpeed = 24
wait(8)
character.Humanoid.WalkSpeed = 16
else
character.Humanoid.WalkSpeed = 16
end
end
end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, string.char(48))
Edit: It's in StarterPlayerScripts
