So the script is supposed to make the player progressively getting faster till it reaches 80, however when you get ragdolled or idle it should go back to the regular walkspeed for the game (10) I thought i looked in humanoidstatetypes to see if there was an idle type but i didnt see it on there so idk what else to put besides "None"
h.StateChanged:connect(function() -- h is the humanoid, the script works ok but it just doesnt slow down the player when it stands
local s = h:GetState()
if s == Enum.HumanoidStateType.None or s == Enum.HumanoidStateType.Ragdoll then
h.WalkSpeed = 10
else
if s == Enum.HumanoidStateType.Running then
while h.WalkSpeed < 80 do
wait(h.WalkSpeed/80*1.5)--wait time increases as walkspeed increases
h.WalkSpeed = h.WalkSpeed + 1
end
end
end
end) |