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.
01 | local dude = script.Parent |
02 |
03 | if dude.WalkSpeed = = 0 then |
04 | script.Disabled = true |
05 | dude.WalkSpeed = 5 |
06 | elseif dude.WalkSpeed > 4 then |
07 | script.Disabled = false |
08 | for i = 5 , 600 , 1 do |
09 | dude.WalkSpeed = i |
10 | wait() |
11 | end |
12 | end |
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)