Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get the childen of game?

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

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.

1 comment

0

Thanks for the explenation.

This discussion is preserved as it was. New answers, comments, and votes are closed.