GetChildren (Function): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer No edit summary |
>Anaminus No edit summary |
||
Line 5: | Line 5: | ||
|returns = [[Table]] ''children'' | |returns = [[Table]] ''children'' | ||
|description = Returns a read-only table of this Object's children | |description = Returns a read-only table of this Object's children | ||
|object = | |object = [[Instance]] | ||
|}}</onlyinclude> | |}}</onlyinclude> | ||
|} | |} | ||
== | ==Description== | ||
{{Example| | |||
<pre> | <pre> | ||
local children = game.Workspace:GetChildren() | local children = game.Workspace:GetChildren() | ||
for | for num, child in pairs(children) do -- pairs iterates through a table | ||
print( | print(num, child.Name) | ||
end | end | ||
</pre> | |||
}} | |||
==See Also== | |||
*[[Tables]] | |||
Revision as of 23:02, 24 October 2010
|
Description
Example
local children = game.Workspace:GetChildren() for num, child in pairs(children) do -- pairs iterates through a table print(num, child.Name) end