generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Dumb Person, Need Amateur Script Help

Previous Thread :: Next Thread 
BloxianBuildingTeam is not online. BloxianBuildingTeam
Joined: 20 Apr 2013
Total Posts: 2137
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
onetimeaccount123 is not online. onetimeaccount123
Joined: 20 Oct 2011
Total Posts: 189
21 Jul 2013 11:57 AM
for _,v in pairs(Workspace:GetChildren()) do
v:Destroy()
end
Report Abuse
BloxianBuildingTeam is not online. BloxianBuildingTeam
Joined: 20 Apr 2013
Total Posts: 2137
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
rosenburger is not online. rosenburger
Joined: 03 Aug 2009
Total Posts: 8407
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
BloxianBuildingTeam is not online. BloxianBuildingTeam
Joined: 20 Apr 2013
Total Posts: 2137
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
onetimeaccount123 is not online. onetimeaccount123
Joined: 20 Oct 2011
Total Posts: 189
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
onetimeaccount123 is not online. onetimeaccount123
Joined: 20 Oct 2011
Total Posts: 189
21 Jul 2013 12:14 PM
^In one line.
Report Abuse
maxlocke99 is not online. maxlocke99
Joined: 10 Apr 2011
Total Posts: 635
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
dabestscripterevar is not online. dabestscripterevar
Joined: 16 Jul 2013
Total Posts: 78
21 Jul 2013 12:41 PM
use destroy
Report Abuse
nickbricknick464 is not online. nickbricknick464
Joined: 22 Aug 2008
Total Posts: 8302
21 Jul 2013 01:03 PM
The easiest way to clear the workspace is

game.Workspace:ClearAllChildren()
Report Abuse
BloxianBuildingTeam is not online. BloxianBuildingTeam
Joined: 20 Apr 2013
Total Posts: 2137
21 Jul 2013 01:05 PM
I will try that Nick.

- 'Nuff said. -
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image