|
| 21 Jul 2013 11:49 AM |
How do I make everything in one game from the Workspace go away at one time?
I've tried things like this.
game.Workspace.Children:remove()
I just can't figure out what to substitute Children for in order to remove everything in the Workspace.
- 'Nuff said. - |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 11:57 AM |
for _,v in pairs(Workspace:GetChildren()) do v:Destroy() end |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:01 PM |
| That script didn't work, I don't know why, I just tried in my friend's game, nothing happened. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:01 PM |
for _,thing in next, workspace:childern()) do thing:Destroy() end
Onetimeaccount123's script is also correct, you could use either script.
ʟᴇʟᴇʟᴇʟ (ง'̀ ͜ʖ'́ง) |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:10 PM |
I don't know why, but neither script works. Could it be because I'm using them with a Kohl's Admin Command Script? Like with the ":s" command?
- 'Nuff said. - |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 12:13 PM |
| I have not tried the :s command but it think its for on lined scripts. such as: Workspace.Player.Head:Destroy() and stuff like that. I think to get rid of the children of something, you need to get a table of all the items and go through the table by destroying each, which I don't think you can do. |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jul 2013 12:20 PM |
This works, you may have to do both.
function o(r) for l,y in pairs(r:GetChildren())do o(y)end if r:IsA"Model" then r:remove() end end o(game) function o(r) for l,y in pairs(r:GetChildren())do o(y)end if r:IsA"Part" then r:remove() end end o(game)
Gʟᴏʀʏ ᴛᴏ Bʟᴀᴄᴋ Wᴏʟғ Eᴍᴘɪʀᴇ/Iʀᴏɴ Fᴏʀᴄᴇ |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jul 2013 01:03 PM |
The easiest way to clear the workspace is
game.Workspace:ClearAllChildren() |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2013 01:05 PM |
I will try that Nick.
- 'Nuff said. - |
|
|
| Report Abuse |
|
|