d = false
function onKeyPress(inputObject, gameProcessedEvent)
if d == true then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
elseif inputObject.KeyCode == Enum.KeyCode.R then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100
d = true
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
it makes me faster and slower once, it works perfectly once. i thought about putting a loop in, but i dont want a wait time. any ideas?

3 comments
Is it a LocalScript in PlayerGui, PlayerScripts, Backpack, or the Player's Character? UserInputService is a Client-Sided service.
tank you, i as using a server script inside the workspace
updated the question, because new problem.