ClearAllChildren (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Flurite No edit summary |
>JulienDethurens ... |
||
(16 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<onlyinclude>{{Method | <onlyinclude>{{Method | ||
|name = ClearAllChildren | |name = ClearAllChildren | ||
|description = | |description = Removes all descendants of the {{type|instance=Instance}}, but leaves the {{type|instance=Instance}} itself. | ||
|object = Instance | |object = Instance | ||
}}</onlyinclude> | }}</onlyinclude> | ||
Line 7: | Line 7: | ||
{{clear floats}} | {{clear floats}} | ||
{{Example| | {{Example|{{code|= | ||
model = game.Workspace.Model | model = game.Workspace.Model | ||
Line 13: | Line 13: | ||
in2 = Instance.new("Sparkles", model) | in2 = Instance.new("Sparkles", model) | ||
game.Workspace.Model:ClearAllChildren() --the part and sparkles in the model will be removed, but the model will | game.Workspace.Model:ClearAllChildren() --the part and sparkles in the model will be removed, but the model will remain | ||
}}}} | |||
[[Category:Methods]] | [[Category:Methods]] |
Latest revision as of 05:56, 7 April 2012
ClearAllChildren( ) | |
Returns | nil |
Description: | Removes 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 remain