GetChildren() returns a table and takes no arguments, so you cannot say: GetChildren('Rainbow Brick') or child.Anchored == true
If part storage contains parts that aren't rainbow bricks, you could do:
child = {}
for _, v in pairs(workspace.PartStorage:GetChildren()) do
if v.Name == 'Rainbow Brick' then
table.insert(child, v)
end
end
Otherwise, if all parts are called rainbow brick, you can just do:
child = workspace.PartStorage:GetChildren()
Since it is a table, you must loop through it for every part, instead of treating it as a singular part, e.g:
for _, v in pairs(child) do
if v.Anchored==false and v.Position.Y<=19.5 then
--code
end
end |