Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 17 Apr 2015 09:40 AM |
explorer:
game -workspace ("Service") --TemporalStorage ("Folder") ---TemporalStorageMaintain ("Script") ---Part ("Part") ---basically random junk (:Clone()'d "Part"s) -other services ("Service")
script:
script.Parent:GetChildren():Destroy()
but how do i make it destroy everything BUT itself? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2015 09:43 AM |
thingthathastobecleaned = game.Workspace.TemporalStorage
for i, v in pairs(thingthathastobecleand:GetChildren()) do if v.ClassName ~= "Script" then -- leaves the script untouched v:Destroy() end end
I guess with in pairs. You can also use 'next' or something. |
|
|
| Report Abuse |
|
|
| |
|
Intern33t
|
  |
| Joined: 19 Nov 2010 |
| Total Posts: 1530 |
|
|
| 17 Apr 2015 09:46 AM |
@seizure
There will probably also be scripts in the tempralstorage that have to be cleared. Is using "if v ~= script then v:Destroy() end" okay? |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2015 09:48 AM |
if v ~= script then
Wouldn't that work? Cause it checks if the Script is itself |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2015 09:54 AM |
| If you want to destroy the script too then just remove the if statement (also the end). Now all children are destroyed. |
|
|
| Report Abuse |
|
|