ChildAdded (Event): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy No edit summary |
>Camoy Removed usage head |
||
Line 9: | Line 9: | ||
== 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 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> | |||
{{Example| | |||
<pre> | |||
function onChildAdded(child) | function onChildAdded(child) | ||
print (child.Name) | print (child.Name) | ||
Line 18: | Line 15: | ||
game.Workspace.ChildAdded:connect(onChildAdded) | game.Workspace.ChildAdded:connect(onChildAdded) | ||
</pre> | </pre>}} | ||
}} |
Revision as of 13:46, 29 August 2010
|
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)
Example
function onChildAdded(child) print (child.Name) end game.Workspace.ChildAdded:connect(onChildAdded)