GetChildren (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>XLEGOx
No edit summary
>Camoy
Redirecting to GetChildren (Method)
 
(34 intermediate revisions by 8 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