So basically the AoeSphere is a part in workspace that if you touch you only get damaged once but heres my script the problem is i am getting damaged not once but twice does anyone know whats wrong with the script I put wait(99) also this all happens under 6 seconds or so no I did not wait(99) seconds to get damaged again also I have a game.Debris:addItem in another line so thats impossible does anyone have a solution
debounce = false
AoeSphere.Touched:Connect(function(touch)
if debounce == true then return end
if debounce == false then
Hum = touch.Parent:FindFirstChild('Humanoid')
if Hum then
Hum:TakeDamage(20)
debounce = true
wait(99)
debounce = false
end
end
end)

1 comment
It's likely because the debounce change is after the damage is dealt. It should be before it is dealt.