So when this script runs it's supposed to decrease the value of health then destroy itself only when it's hit by an explosion, but it just does it on it own without being blown up.
local health = script.Parent.Parent.Parent.Health
local debounce = false
local explosion = workspace:FindFirstChild("Explosion")
modelsHit = {}
explosion.Hit:connect(function(part)
if debounce == false then
debounce = true
end
part = script.Parent
if modelsHit[part] then
return
end
modelsHit[part] = true
if modelsHit[part] == true then
health.Value = health.Value - 10
wait(3)
debounce = false
script.Parent:Destroy()
end
end)

1 comment
Hit runs every time te explosion explodes