very descriptive title i know
basically i have an in ipairs loop going through an table and im checking if all the parts in the table meet a condition
for i, piece in ipairs(pieces) do
if piece.Position == randomPart.Position then
break
end
end
return(something)
basically i want it to return only if all pieces are not in that position
if it goes through it without any pieces being in that position, it returns
and when the loop detects that there is a part in that position, it breaks the loop because it doesnt have to continue now that it knows a part is in that position
but then because of sequencing it just returns anyways
and i cant have an “else” that returns it because that will return after a single part is found to not be in that position
so
how would i return this ONLY if ALL MEMBERS OF THE TABLE meet the criteria of not being in that position?