This is a program that is supposed do splash damage to everyone touching the part every .25 seconds except for the player the script is in. It doesn’t work, how do I fix it?
part = game.Workspace.part
i = 0
while i <= 2.5 do
local victims = {script.Parent}
local enabletouchinterest = part.Touched:Connect(function()end)
for _, object in ipairs(part:GetTouchingParts()) do
if object.Parent:FindFirstChild("Humanoid") then
for _, damaged in ipairs(victims) do
if object.Parent ~= damaged then
table.insert(victims,#victims+1,object.Parent)
object.Parent.Humanoid.Health = object.Parent.Humanoid.Health - 10
end
end
end
end
enabletouchinterest:Disconnect()
wait(.25)
i = i+.25
end