local Reg = MakeRegion(mouse.Target.Position)
local Parts = workspace:FindPartsInRegion3(Reg,game.Players,math.huge)
for i,v in pairs (Parts) do
if mode == "ignoring" then
if v.Color == ignoreColor then
table.remove(Parts,i)
end
elseif mode == "target" then
if v.Color ~= targetColor then
table.remove(Parts,i)
end
end
end
So the snippet of code above is supposed to remove all parts in the table that aren’t the color of targetColor when it is enabled, or are the color of ignoreColor when it is enabled. But for reasons I don't understand, when I print the length of the table at the end, it has only removed half and then stopped. Does anyone know why this is and what I could do about it?

1 comment
No problem!