|
| 17 Jul 2011 10:13 PM |
| how do i delete everything thats currently in workspace |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 17 Jul 2011 10:15 PM |
| i dunno how to do that! D: can u just give me a script pwease |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2011 10:16 PM |
| i wanna make it so that one script deletes everything inside workspace |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
| |
|
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 |
|
|