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
script.Parent.Touched:connect(function(hit)
local player = hit.Parent:FindFirstChild('Humanoid')
if player then
player.Health = -60
end
end)

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