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

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

Asked by 7 years ago
Edited by OldPalHappy 7 years ago

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

Log in to vote
0
Answered by 7 years ago

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)

Ad

Answer this question