skate1011
|
  |
| Joined: 13 Mar 2010 |
| Total Posts: 688 |
|
|
| 07 Oct 2012 12:10 AM |
so I wanted to know if I could do this with ipairs
w = game.Workspace:GetChildren() l = game.Lighting:GetChildren() sg = game.StarterGui:GetChildren() sp = game.StarterPack:GetChildren()
for _, v in pairs(w, l, sg, sp) do if v:IsA("Terrain") then else v:Remove() end end
wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 12:20 AM |
| First of all, you can't remove the Terrain object. |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 12:22 AM |
No. Just do this:
w = game.Workspace:GetChildren() l = game.Lighting:GetChildren() sg = nil sp = game.StarterPack:GetChildren()
for k,v in pairs(game.Players.Players:GetPlayers()) do --this is so sg is the PlayerGuis for a,b in pairs(v.PlayerGui:GetChildren()) do table.insert(sg, b) end end
tbls = {l, sp, sg}
for k,v in pairs(tbls) do v:ClearAllChildren() for a,b in pairs(w) do if not a.Name == "Terrain" and not a.Name == "Camera" then b:destroy() end end end
http://wiki.roblox.com/index.php/User:ElectricBlaze |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Oct 2012 02:18 AM |
@thecaptain - I'm using his scripting style. That's obviously not the most efficient way to do it, but I don't want to force a certain style upon him. Let him learn at his own pace.
http://wiki.roblox.com/index.php/User:ElectricBlaze |
|
|
| Report Abuse |
|
|