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

How would I make walk speed increase while walking and reset?

I'm attempting to change the WalkSpeed property by 0.2 every 0.5 seconds until the WalkSpeed equals to 20 however, after stopping the WalkSpeed will return to 16. I have looked everywhere to do something like this. Please don't see this as a request I just need something to help lead me into the right direction.

2 comments

0

have you not attempted this your self? if so please post some code as well so people can help you properly, if you haven't then try it first and if it fails present us with the failed so we can point out what to do and maybe give you a solution

0

couple of errors in there, sorry

1 answer

✓ Accepted answer

You'll need a humanoid signal called .Running.

It's used like this.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local Humanoid = char:WaitForChild('Humanoid')
		Humanoid.Running:Connect(function(Speed)
			--//Speed is the walkspeed of the character. If the character is not running, it will return a very small number, if not zero.
			--//You could probably make a constant loop to check if the character is running or not, or simply use a .Changed function to check if the moveDirection is > Vector3.new(5,5,5), or so. It's your choice!
			if (Speed > 0) then
				print'Player is running!'
			else
				print'Player has stopped!'
			end
		end)
	end)
end)

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