ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 01 Aug 2011 06:13 PM |
I'm trying to make a clean script, but it's not working. Here it is:
local a = game.Workspace:children() for i = 1, #a do if a[i].className == "Script" then a[i]:remove() if a[i].className == "Part" then a[i]:remove() if a[i].className == "Model" then a[i]:remove() end end end end
Anything wrong with it? |
|
|
| Report Abuse |
|
|
TwoBoo
|
  |
| Joined: 08 Feb 2011 |
| Total Posts: 10790 |
|
|
| 01 Aug 2011 06:19 PM |
for i, v in pairs (Workspace:GetChildren()) do v:remove() end
|
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 06:20 PM |
:GetChildren() rather than :children(), line 1.
Also, you can use
local a = game.Workspace:GetChildren() for i = 1, #a do if ((a[i].ClassName == "Script") or (a[i].ClassName == "Part") or (a[i].ClassName == "Model)) then a[i]:Remove() end end |
|
|
| Report Abuse |
|
|