ClearAllChildren (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SCARFACIAL
Created page with "<onlyinclude>{{Method |name = ClearAllChildren |description = Calls Remove on all descendants of the Instance, but leaves the Instance itself. |object = Instan..."
>Flurite
No edit summary
Line 8: Line 8:


{{Example|<pre>
{{Example|<pre>
game.Workspace.Model:ClearAllChildren()
model = game.Workspace.Model
 
in1 = Instance.new("Part", model)
in2 = Instance.new("Sparkles", model)
 
game.Workspace.Model:ClearAllChildren() --the part and sparkles in the model will be removed, but the model will prevail
</pre>}}
</pre>}}


[[Category:Methods]]
[[Category:Methods]]

Revision as of 13:33, 24 December 2011

ClearAllChildren( )
Returns nil
Description: Calls Remove on all descendants of the Instance, but leaves the Instance itself.
Member of: Instance


Example
model = game.Workspace.Model

in1 = Instance.new("Part", model)
in2 = Instance.new("Sparkles", model)

game.Workspace.Model:ClearAllChildren() --the part and sparkles in the model will be removed, but the model will prevail