So I'm trying to make a model appear when a zombie dies to delete it and have it explode the code I am using is this
health = script.Parent:findFirstChild("Humanoid")
debounce = false
local self = script.Parent:clone()
while true do
wait(0.1)
if (health.Health == 0) then
if (debounce == true) then return end
debounce = true
wait(1)
t = game.Lighting.Part:Clone()
t.Parent = game.Workspace
wait(10)
t:remove()
local clone = self:clone()
clone.Parent = game.Workspace
clone:MakeJoints()
script.Parent:remove()
end
end
and I've tried changing it to the negatives I've been getting but that hasn't worked so I want a way to avoid negative health

1 comment
If you are using a Humanoid, you should not have issues with negative values for health because the Humanoid should round all negatives up to 0.