function onTouch(hit)
if debounce == false then
debounce = true
if hit.Name ~= “Ignoreme” then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health -DamageValue
elseif hit.Name == "Ignoreme" then
hit.Parent.Parent.Humanoid.Health = hit.Parent.Parent.Humanoid.Health -DamageValue
wait(4)
debounce = false
end
end
What’s happening is that when the if hit.Name ~= "IgnoreMe" condition is true, the debounce variable never goes back to false. You should always have both debounce toggles within the same condition
This isn’t the issue, and also moving the debounce = true to inside the elseif won’t make the debounce return to false if hit.Name ~= “IgnoreMe”` condition is true. The debounce will be properly set up if you move the debounce = false to after the elseif (so between the last two ends).
The issue that the ouput shows is that the humanoid is not a valid member of the unionoperation IgnoreMe.
sorry to go off topic, you can do hit.Parent.Humanoid:TakeDamage(DamageValue) to simplify the code
you could also do hit.Parent.Humanoid.Health -= DamageValue