I'm trying to make a part that'll damage humanoids that touch it but only if they are not in the table. Once they've been touched, they'll be put inside the table and won't be able to take any more damage for one second.
local checkList = {}
local debounce2 = false
hitBox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') and not debounce2 then
debounce2 = true
for i,v in pairs(checkList) do
if v == hit.Parent then
-- do nothing
elseif v ~= hit.Parent then
table.insert(checkList,hit.Parent)
v.Humanoid:TakeDamage(10)
wait(1)
debounce2 = false
end
end
end
end)

4 comments
u cant do that u just have to make multiple touched events i think
??
for do nothing just have it say return and for tables i would recommend using strings and the name of the object like hit.Parent.Name
it didn't make a difference sorry