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

How would I make a loop that goes through every object in the game?

Asked by 9 years ago

Self-explanatory. How would I achieve that?

1 answer

Log in to vote
0
Answered by 9 years ago

Well, if you just mean the direct children of game, you could easily do it like this:

for i,v in pairs(game:GetChildren()) do print(v.Name) end

But if you wanted it to loop through every single child game has through it's hierarchy you could use recursion.

0
What's recursion? SquirreIOnToast 309 — 9y
Ad

Answer this question