So I have script that increases the characters speed while they run, but I want to have a maximum speed that it cant go above.
Script:
local Running = false
game.Players.PlayerAdded:Connect(function(player)
repeat wait() until player.Character
local Humanoid = player.Character:WaitForChild("Humanoid")
if newState == Enum.HumanoidStateType.Running or
newState == Enum.HumanoidStateType.RunningNoPhysics then
if not Running then Running = true
repeat wait(0.1)
Humanoid.WalkSpeed = Humanoid.WalkSpeed + .8
until not Running
Humanoid.WalkSpeed = 20
end
elseif not Enum.HumanoidStateType.Jumping then
Running = false
end
end)
end)

1 comment
thank you!