for _,v in pairs(game.Workspace.Part:GetChildren()) do
local debounce = false
local cd = 2
v.Touched:Connect(function(hit)
debounce = true
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(10)
wait(cd)
debounce = false
end
end)
end
You aren’t using the debounce anywhere. You’re setting it to true and false, but doing nothing with it. You need to actually check the debounce in the if statement for it to actually work.