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: Deleting Inside workspace

Previous Thread :: Next Thread 
robotoblok is not online. robotoblok
Joined: 14 Nov 2009
Total Posts: 207
17 Jul 2011 10:13 PM
how do i delete everything thats currently in workspace
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
17 Jul 2011 10:14 PM
Make a table of the children in the workspace then use a for loop to index every object and remove them each.
Report Abuse
robotoblok is not online. robotoblok
Joined: 14 Nov 2009
Total Posts: 207
17 Jul 2011 10:15 PM
i dunno how to do that! D: can u just give me a script pwease
Report Abuse
robotoblok is not online. robotoblok
Joined: 14 Nov 2009
Total Posts: 207
17 Jul 2011 10:16 PM
i wanna make it so that one script deletes everything inside workspace
Report Abuse
EMAN381 is not online. EMAN381
Joined: 27 Nov 2007
Total Posts: 4300
17 Jul 2011 10:17 PM
kk,

x = game.workspace:children() --Get all the things in workspace
for i = 1,#x do --For each one, do
x[i]:remove() --Remove them.
end
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
17 Jul 2011 10:18 PM
Then you won't learn anything!

To get the children of an object you can use the GetChildren method which puts all the children of an object into a table.

Table = workspace:GetChildren()

Then we need to remove each child seperately by using a for loop to index each child.

for _,v in pairs(Table) do
v:Remove()
end
Report Abuse
robotoblok is not online. robotoblok
Joined: 14 Nov 2009
Total Posts: 207
17 Jul 2011 10:18 PM
THX!! :D
Report Abuse
EMAN381 is not online. EMAN381
Joined: 27 Nov 2007
Total Posts: 4300
17 Jul 2011 10:21 PM
No I made him learn.

I told him what they all did for each line.

Then he could study for what I did. :3
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