GetChildren (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer
m GetChildren moved to GetChildren (Function)
>Camoy
Redirecting to GetChildren (Method)
 
(25 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Function|
#REDIRECT [[GetChildren_(Method)]]
name                  = GetChildren
|arguments            =
|returns              = [[Table]] ''children''
|description          = Returns a read-only table of this Object's children
|object              = Global
|}}
 
==Example==
(Outdated example)
<pre>
 
local children = game.Workspace:GetChildren()
for c = 1, #children do
    print(c.Name)
end
 
</pre>
(More efficient example)
<pre>
local children = game.Workspace:GetChildren()
for i, j in ipairs(children) do
    print("index: ")  --j is the object, i is the index of the table it is at
    print(i)
    print("Object: ")
    print(j)
end</pre>

Latest revision as of 12:31, 18 January 2011