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

How do I get the childen of game?

Asked by 9 years ago

How do I get the children of Game (the DataModel)?

Things I've tried

for _,v in pairs(game:GetChildren()) do
    print(v.Name..'; '..v.ClassName)
end
--This results in an unknown error.

Now, if I try to do this to workspace:

for _,v in pairs(workspace:GetChildren()) do
    print(v.Name..'; '..v.ClassName)
end
--This actually prints out Workspace's children.

Any help would be appreciated.

1 answer

Log in to vote
1
Answered by
Marios2 360 Moderation Voter
9 years ago

My theory is that the DataModel is RobloxLocked, so you can't do anything to it. To get all instances in a game, you'd have to get the children of all the services that contain anything.

Pretty much all you can do to game is stuff like print() (print(game), print(game.ClassName) etc.)

In other words, you can't directly obtain a whole game's children.

0
Thanks for the explenation. Vlatkovski 320 — 9y
Ad

Answer this question