hello thanks for lending me your time, I was wondering if it was possible to insert a whole segment of an array into another one given a certain condition. I can't figure out why this isnt working:
local parts = map:GetChildren() local mapparts = {} for _, p in ipairs (parts) do if p.Name == "mappiece" then table.insert (mapparts, p) end end
i dont know why it only inserts 1 value into the table 'mapparts', could anyone help me out? thanks! (table parts has a lot of parts named mappiece)
ok sorry im stupid, i did it wrong, but anyways, if anyone would like to know how i did it for future reference;
local parts = map:GetChildren() local mapparts = {} function sorter(part) if part.Name == "mappiece" then table.insert(mapparts,part) end end for _, wotowot in ipairs (parts) do sorter(wotowot) end