How to make an object 's child into a list?
For example
Object
Red
Blue
Yellow
and the output would be
{Red,Blue,Yellow}
How to make an object 's child into a list?
For example
Object
Red
Blue
Yellow
and the output would be
{Red,Blue,Yellow}
Are you talking about all children in an Instance
? You can use Instance:GetChildren()
to get this exact array.
what if i want to get it as game.object.blue?
Do you mean as a string path?
Do you mean like this?
Can also just do it without tables.
for _, part in pairs(workspace:GetChildren()) do
if part:IsA("Part") then
print(part.BrickColor)
end
end
If you are referring to the object’s path, use the instance’s method Instance:GetFullPath()
.