ChildAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>NXTBoy
No edit summary
>Camoy
No edit summary
Line 1: Line 1:
<onlyinclude>{{Event|name=ChildAdded
{|
|arguments=[[Instance]] Child
|<onlyinclude>{{Event|name = ChildAdded
|description=Fired after a child is added.
|arguments = [[Instance]] Child
|object=Instance
|description = Fired after a child is added.
}}</onlyinclude>
|object = [[Instance]]
{{clear floats}}
|}}</onlyinclude>
|}
 
== Description ==
== Description ==
Event is triggered when a new child has this object set as a parent. It applies only to immediate children and not other [[IsDescendantOf (Function)|Descendants]]. (See [[DescendantAdded (Event)|DescendantAdded]])
Event is triggered when a new child has this object set as a parent. It applies only to immediate children and not other [[IsDescendantOf (Function)|Descendants]]. (See [[DescendantAdded]])


== Usage ==
== Usage ==
Example:
{{Example|
<pre>
<pre>
function onChildAdded(child)
function onChildAdded(child)
Line 17: Line 19:
game.Workspace.ChildAdded:connect(onChildAdded)
game.Workspace.ChildAdded:connect(onChildAdded)
</pre>
</pre>
[[Category:Events]]
}}

Revision as of 21:56, 28 August 2010

ChildAdded ( Instance Child )
Description Fired after a child is added.
Member of: [[RBX.lua.Instance (Object)|Instance]]

Description

Event is triggered when a new child has this object set as a parent. It applies only to immediate children and not other Descendants. (See DescendantAdded)

Usage

Example
function onChildAdded(child)
  print (child.Name)
end

game.Workspace.ChildAdded:connect(onChildAdded)