This script's goal is to make the player slow down when his health is down.
?player = game.Workspace.Player1.Humanoid function painspeed() if player.Health <= 15 then player.WalkSpeed = 11 else player.Walkspeed = 20 end end painspeed()
Why doesn't this work? Please help.?
player = game.Workspace.Player1:WaitForChild("Humanoid") while wait() do player.WalkSpeed=(player.Health / player.MaxHealth) * 16 end