DescendantAdded (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Flurite
No edit summary
>JulienDethurens
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>{{Event|name = DescendantAdded
<onlyinclude>{{Event|name = DescendantAdded
|arguments = [[Instance]] ''descendant''
|arguments = [[Instance]] <var>descendant</var>
|description = Fired after a descendant is added.
|description = Fired when a descendant is added to the object.
|object = Instance
|object = Instance
}}</onlyinclude>
}}</onlyinclude>
Line 7: Line 7:
{{clear floats}}
{{clear floats}}


{{Example| This code will print the name of any object that is parented under [[Workspace]]<code lua>
== Example ==
local function onDescendantAdded(ins)
 
  print(ins)
This code will print the name of any object that is added to the Workspace:
end
 
game.Workspace.DescendantAdded:connect(onDescendantAdded)
{{code|=
</code>}}
Workspace.DescendantAdded:connect(function(descendant)
print(descendant)
end)
}}


[[Category:Events]]
[[Category:Events]]

Latest revision as of 06:04, 10 April 2012

DescendantAdded ( Instance descendant )
Description Fired when a descendant is added to the object.
Member of: Instance


Example

This code will print the name of any object that is added to the Workspace:

Workspace.DescendantAdded:connect(function(descendant)
	print(descendant)
end)