I've tried with this script and many other scripts but they only damage 1 person at a time
local trapPart = script.Parent local Debounce = false local function onPartTouch(otherPart) local partParent = otherPart.Parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") if ( humanoid ) then if Debounce == false then Debounce = true humanoid:TakeDamage(5.5) wait(0.2) Debounce = false end end end trapPart.Touched:Connect(onPartTouch)
Your debounce will only allow damage to one player at once after which the code will wait. You would use a table to keep track of what has had damage taken within your cooldown time.
Example:-
local trapPart = script.Parent local plrServ = game:GetService("Players") local lst = {} trapPart.Touched:Connect(function(hit) local humanoid = hit.Parent:FindFirstChildWhichIsA("Humanoid") if not humanoid then return end -- no humanoid if lst[humanoid] then return end -- humanoid is in the list lst[humanoid] = true humanoid:TakeDamage(5.5) wait(0.2) lst[humanoid] = nil end)
The table will act like a debounce as you cannot take damage if you are in the table.
I hope this helps.