GetChildren (Function)

From Goodblox Wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Function
Syntax GetChildren( )
Returns Table children
Description: Returns a read-only table of this Object's children
In Object: Global


Example

(Simple example)

local children = workspace:GetChildren()
for c = 1, #children do
     print(children[c].Name)
end

(More efficient example)

local children = workspace:GetChildren()
for i, item in pairs(children) do
     --"item" is the object, "i" is the index of the table it is at
     print("index: "..i)
     print("Object: "..item)
end