local debounce = true
local function OnTouched(part)
if debounce then
--script
debounce = false
wait(10000000000)
debounce = true
end
end
script.Parent.Touched:connect(OnTouched)
how can I make the debounce true when you die? I tried to do this:
local debounce = true
local function OnTouched(part)
if debounce then
--script
debounce = false
wait(10000000000)
debounce = true
end
end
script.Parent.Touched:connect(OnTouched)
if humanoid.Health == 0 then
debounce = true
end
but it didnt work can someone help me?

2 comments
When the character dies, it immediately replaces the character along with its children. That's why you can't get the debounce working.
What??? It doesn't work because (assuming you actually set humanoid) that if statement only runs once it's not gonna constantly check. You need to use Humanoid.Died