The script below makes the part disappear after being touched by anything, which is a problem. But I don't know how I will make it so it will only disappear after being touched by a certain object.
health = script.Parent.Parent.Parent.Health
local debounce = false
function onHit()
if debounce == false then
debounce = true
health.Value = health.Value - 10
print (health.Value)
wait(3)
debounce = false
script.Parent:Destroy()
end
end
script.Parent.Touched:connect(onHit)
