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

How do I make a timed walk speed script?

Asked by 3 years ago

I am trying to make the players walk speed go down to 10 after 70 seconds has passed. I have a very simple code that changes the players walk speed when the join the game. I just assumed if I put a wait(70) before the code it would wait 70 seconds then activate, but it doesn't.

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character.Humanoid.WalkSpeed = 10
    end)
end)

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

you should put it in a while loop!

local customSpeed = 16

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
    while wait(70) do
          character.Humanoid.WalkSpeed = 10
      wait(70)
      character.Humanoid.WalkSpeed = customSpeed
    end
    end)
end)

0
Thanks so much. Nightmarish_Ideas 7 — 3y
Ad

Answer this question