I am using a debounce for this, I don't want the part spam :TakeDamage(10) making it unfair, it is also unfair because a single unlucky person will get hit. I want to make the part damage several players without making the part spam alots of :TakeDamage() making the part overpowered. Here's an example:
local debounce = false
script.Parent.Touched:Connect(function(hit)
local human = hit.Parent:FindFirstChildOfClass("Humanoid")
if hit.Parent.Name ~= "cherrythetree" then
if human and debounce == false then
debounce = true
human:TakeDamage(10)
wait(2)
debounce = false
end
end
end)
Anyone help???

7 comments
ur debounce is wrong
ur script is basically saying once one player touches it, it will wait 2 seconds before accepting the input of another player touching it
So what will I use? else or wait(2) or disable debounce?
have the debounce on the client side or have a plr debounce list
ur method works fine when there is only one guy touching the thing
however when a lot of people touch it at once the logic will tell u it cant simultaneously damage them all
Use coroutines.