Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can you get children of get children?

Asked by 7 years ago

Just wondering if it would be possible to get the children of children through get children?

EX:

objectsInTheChildrenOfWorkspace  =  game.Workspace:GetChildren():GetChildren()
print(objectsInTheChildrenOfWorkspace)

Thanks

1 answer

Log in to vote
1
Answered by
Bertox 159
7 years ago

Try this:

for i,Child in pairs(game.Workspace:GetChildren()) do --Gets children of workspace
    for i,Child2 in pairs(Child:GetChildren()) do --Gets children of the children in Workspace
        Child2.Transparency = 1 --Example
    end
end
0
Cool TSK_Uncovered 55 — 7y
Ad

Answer this question