GetChildren (Function): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>KnKGames.Com
No edit summary
>Darkzero
No edit summary
Line 1: Line 1:
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
{{Function|
I am permantly banned from roblox!
name                  = GetChildren
|arguments            =
|returns              = [[Table]] ''children''
|description          = Returns a read-only table of this Object's children
|object              = Global
|}}


Please Spread The Word!
==Example==
(Outdated example)
<pre>


local children = game.Workspace:GetChildren()
for c = 1, #children do
    print(c.Name)
end


 
</pre>
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
(More efficient example)
I am permantly banned from roblox!
<pre>
 
local children = game.Workspace:GetChildren()
Please Spread The Word!
for i, j in ipairs(children) do
 
    print("index: ")  --j is the object, i is the index of the table it is at
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
    print(i)
I am permantly banned from roblox!
    print("Object: ")
 
    print(j)
Please Spread The Word!
end</pre>
 
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
 
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!
Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!Attention Everyone: I did not phish Roni123’s acount! Someone hacked knkgames.com! Talk to Roni123 for more details!
I am permantly banned from roblox!
 
Please Spread The Word!

Revision as of 08:58, 2 July 2008

GetChildren( )
Returns Table children
Description: Returns a read-only table of this Object's children

Example

(Outdated example)


local children = game.Workspace:GetChildren()
for c = 1, #children do
    print(c.Name)
end

(More efficient example)

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