Fireball damages multiple times, even though I'm using a Debounce

Here’s a snipet of the code that doesn’t seem to work:

FireballClone.Touched:Connect(function(Hit)
    	local HitCharacter = Hit.Parent
    	local Humanoid = HitCharacter:FindFirstChild("Humanoid")
		
	local Debounce = false
		
	if HitCharacter.Name ~= FireballClone.Name and Humanoid and Debounce == false then
		Debounce = true
		Humanoid.Health = Humanoid.Health - 20
	end
end)

Any solutions?

This is because you have to define the debounce above/outside of the function. When you create the variable for it & set its initial value inside of the function, it’ll pretty much be “reset” each time the function is activated.

local Debounce = false

FireballClone.Touched... -- etc.
2 Likes