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

How do i get all the children from one instance?

Asked by
Derzett 51
4 years ago

So basically i'm trying to get ALL the children from the game's Workspace. Like even the childrens children but i have no idea how to do it except getting all the children and repeating the for loops on the childrens children and so on and so on.

1 answer

Log in to vote
1
Answered by 4 years ago

I would actually use the GetDescendants function to get every single child inside of an instance. For example:

for index, value in pairs(game.Workspace:GetDescendants()) do
    --//value is the current item we are iterating through
end
Ad

Answer this question