This should cause the WalkSpeed of the players to increase by 1 everytime "R" is pressed.
It doesn't work
Player = game.Players.LocalPlayer Character = Player.Character Humanoid = Character.Humanoid WalkSpeed = Humanoid.WalkSpeed
game:GetService("UserInputService").InputBegan:connect(function(LetsSee) if LetsSee.KeyCode == Enum.KeyCode.R then print("R was pressed") WalkSpeed = WalkSpeed + 1 end end)
This is because you are incrementing the value of your WalkSpeed
variable, and not the WalkSpeed
property of the player character's Humanoid object. WalkSpeed
and Character.Humanoid.WalkSpeed
are two different variables.