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