Burn effect only going on 1 humanoid at a time

Like the title says, the “BURNED” effect and the fire particles only go on 1 thing that has a humanoid. The burn damage seems to work just fine though. And yes, I have tried putting the burning effects into that but that just makes the whole thing break.
Here’s a gif of my issue: https://gyazo.com/30eb97d4b6eaef8e219d78bfb41abd6f

 local Debounce = false

function onTouched(hit)
	if not Debounce then
		local player = hit.Parent
		local Owner = script.Parent.Owner
		local firefx = game.ReplicatedStorage.Fire:Clone()
		local status = firefx.Stunned:Clone()
		local humpart = hit.Parent
		if player:FindFirstChild("Humanoid") ~= nil and player.Name ~=  Owner.Value and Debounce == false then
			Debounce = true
			firefx.Parent = humpart.HumanoidRootPart
			status.Parent = humpart.Head
			wait(2.4)           --Change cooldown here
			Debounce = false
		end
end
end

script.Parent.Touched:connect(onTouched)
1 Like

Its due to the debounce.
The script won’t run again when touched until Debounce = false
even if another Humanoid is hit by it

1 Like

Yeah I removed the debounce script, it works but makes the humanoid get hit multiple times.

1 Like

Try using a table with the script only working if the player is not in that table, and add the player to that table before the wait function, and remove them after the wait function.

1 Like

Ok, I’ll try that. I’ll be sure to let you know if that works.

Perhaps when you’re adding the fire into the character, in the if statement where you’re adding a fire to the character, add a condition that if not characterobject:findfirstchild(“fire”), maybe that will make it work. Also, you should change your variable for “player” to “character” because a “player” are players under the player service and a “character” is the physical body of player.

1 Like

Do I also get rid of the debounce part?

1 Like

Yah you don’t need the debounce since you only want it to have a cooldown for the Humanoid that gets hit and not the server as a whole.

1 Like

You are a major lifesaver, thank you so much

1 Like

No problem, if that worked you can mark my reply as the solution so anyone else who views this will know it’s been solved. :+1: