ClearContent (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>LocalChum added {{locked}} |
>JulienDethurens No edit summary |
||
Line 2: | Line 2: | ||
<onlyinclude>{{Method | <onlyinclude>{{Method | ||
|name = ClearContent | |name = ClearContent | ||
|arguments = [[ | |arguments = [[bool]] <var>resettingSimulation</var> | ||
|description = If | |description = If <var>resettingSimulation</var> is {{false}}, it removes everything in the Workspace. If <var>resettingSimulation</var> is {{true}}, it removes everything in the game; this includes CoreGui, Players, and Workspace. | ||
|object = DataModel | |object = DataModel | ||
|protected = Yes | |protected = Yes | ||
Line 11: | Line 11: | ||
{{Example| | {{Example| | ||
If you're using the [[ | If you're using the [[command bar]] or a [[CoreScript]]... | ||
{{code|=game:ClearContent(true) | |||
game:ClearContent(false) -- removes everything in game.Workspace\ | game:ClearContent(false) -- removes everything in game.Workspace\ | ||
}} | |||
If you're using a [[Script]] or a [[LocalScript]]... | If you're using a [[Script]] or a [[LocalScript]]... | ||
{{code|=game:ClearContent(true) --> s ClearContent | |||
game:ClearContent(false) --> s ClearContent | game:ClearContent(false) --> s ClearContent | ||
}}}} | |||
[[Category:Methods]] | [[Category:Methods]] |
Revision as of 19:58, 7 April 2012
Protected:This item is protected. Attempting to use it in a Script or LocalScript will cause an error.
![]() | |
Returns | nil |
Description: | If resettingSimulation is false, it removes everything in the Workspace. If resettingSimulation is true, it removes everything in the game; this includes CoreGui, Players, and Workspace. |
Member of: | DataModel |
Example
If you're using the command bar or a CoreScript...
game:ClearContent(true)
game:ClearContent(false) -- removes everything in game.Workspace\
If you're using a Script or a LocalScript...
game:ClearContent(true) --> s ClearContent
game:ClearContent(false) --> s ClearContent