ChildAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
Removed usage head
>JulienDethurens
No edit summary
 
(26 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{|
<onlyinclude>{{Event
|<onlyinclude>{{Event|name = ChildAdded
|name = ChildAdded
|arguments = [[Instance]] Child
|arguments = [[Instance]] <var>child</var>
|description = Fired after a child is added.
|description = Fired after a child is added.
|object = [[Instance]]
|object = Instance
|}}</onlyinclude>
}}</onlyinclude>
|}


== Description ==
<div class="visualClear"></div>
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]])
{{Example|<pre>
function onChildAdded(child)
  print (child.Name)
end


game.Workspace.ChildAdded:connect(onChildAdded)
== Example ==
</pre>}}
 
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]]).{{code|=
Workspace.ChildAdded:connect(function(child)
print(child.Name)
end)
}}
 
[[Category:Events]]

Latest revision as of 02:18, 25 March 2012

ChildAdded ( Instance child )
Description Fired after a child is added.
Member of: Instance

Example

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).

Workspace.ChildAdded:connect(function(child)
	print(child.Name)
end)