Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script not work?

Asked by 9 years ago
1script.Parent.Touched:connect(function(hit)
2local player = hit.Parent:FindFirstChild('Humanoid')
3if player then
4player.Health = -60
5end
6end)

Why wont it take only 60 health?

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

You are setting the health to -60, you aren't subtracting 60.

player.Health = player.Health-60

Ad

Answer this question