Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this work? Please help.?

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.?

1 answer

✓ Accepted answer
player = game.Workspace.Player1:WaitForChild("Humanoid")

while wait() do
player.WalkSpeed=(player.Health / player.MaxHealth) * 16 
end

3 comments

0

THANKS

0

np.

0

Where do I put this local script?

This discussion is preserved as it was. New answers, comments, and votes are closed.