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

How to make a humanoid move like a car while running?

So in this script, the Parent is the humanoid. I made this but doesn't get my desired result. I have no idea how to make the WalkSpeed reset after the player stops running or dies.

local dude = script.Parent

if dude.WalkSpeed == 0 then
	script.Disabled = true
	dude.WalkSpeed = 5
elseif dude.WalkSpeed > 4 then	
	script.Disabled = false
	for i = 5,600,1 do
		dude.WalkSpeed = i
		wait()
	end
end

1 answer

✓ Accepted answer

The reason this doesn't work is because Walkspeed is always constant, which basically means that once you set it to a certain value, say 17, it would always stay constant, even when the player isn't moving, so if you figure out a way to set if a player is moving or not, use that. (Sorry I don't have the exact answer, this isn't my area of strong suit)

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