|
| 28 Sep 2011 07:19 PM |
for i, v in pairs(game.Workspace:GetChildren()) do if (v.Enemy ~= nil) then v.Enemy:Remove()
would this remove everything (not in a model) in workspace named 'Enemy'?
sorry about so many topics lol. this should be the last. |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 28 Sep 2011 07:21 PM |
Kill = "Enemy"
function findKill(obj) for _,v in pairs(obj:GetChildren()) do if v.Name == Kill then v:remove() elseif v.Name ~= Kill then findKill(v) end end
findKill(workspace)
|
|
|
| Report Abuse |
|
|
1Ra
|
  |
| Joined: 02 May 2010 |
| Total Posts: 2400 |
|
|
| 28 Sep 2011 07:21 PM |
| if you added 2 ends, then yes |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 07:21 PM |
| This would not work without ends, but it should remove anything in workspace that has a child named "Enemy." |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 07:25 PM |
| oh yea i forgot about the ends.. |
|
|
| Report Abuse |
|
|