Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a timed walk speed script?

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

✓ Accepted answer

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)

1 comment

0

Thanks so much.

This discussion is preserved as it was. New answers, comments, and votes are closed.