|
| 28 Aug 2013 09:16 AM |
that have the same name like for example theres a bunch of parts named cheese in your place and you want to get rid of them but they're inside a bunch of different models |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Aug 2013 09:21 AM |
Hm. I was going to answer with "GetChildren()" but then I realized I don't know how to do unlimited recursive... things, whatever they're called, yet.
To ask ahead of time, would "cheese" be a name you as the placemaker set somehow, or would it just check for things that have copies? The former is easier, the latter may be drastically harder. |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 28 Aug 2013 09:24 AM |
local n0bname = "cheese"
local function search(obj) for _, v in pairs(obj:GetChildren()) do if v.Name == n0bname then v:Destroy() else search(v) end end end
search(workspace) |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 09:24 AM |
well its kind of like this i was gonna make a statue so to get some ideas, i went to models and looked up some statues and inside one of them had a vaccine which inserts a "Fire" and a "Vaccine" script into every brick under workspace |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 09:24 AM |
function Delete(Location) for Index, Child in pairs(Location:GetChildren()) do if Child.Name == "Cheese" then Child:Destroy() end Delete(Child) end end
Delete(Workspace) |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 09:27 AM |
knight that last part looks funny |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 09:28 AM |
| It's just the function's name. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 28 Aug 2013 10:42 AM |
Or we can just use
game.Workspace.Model:ClearAllParts() |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2013 10:46 AM |
for i, v in pairs(Workspace:GetChildren()) do if v.Name == "Cheese" then destroy()
I'm somewhat new, but I think that would work.
;n; |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
| |
|