Kyuro
|
  |
| Joined: 03 Sep 2012 |
| Total Posts: 5800 |
|
|
| 07 May 2014 07:23 AM |
| e.g. Remove a character of all of its hats? |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 07 May 2014 07:36 AM |
for _,v in pairs(model) if v:IsA("Hat") then v:Destroy() end end |
|
|
| Report Abuse |
|
|
Kyuro
|
  |
| Joined: 03 Sep 2012 |
| Total Posts: 5800 |
|
|
| 13 May 2014 09:09 PM |
| Um, I don't exactly understand.. |
|
|
| Report Abuse |
|
|
Vuva
|
  |
| Joined: 22 Jan 2010 |
| Total Posts: 1102 |
|
|
| 13 May 2014 09:50 PM |
It lopos through all of the children of "model", and destroys each child that is a "Hat"
for _,v in pairs(model) --A generic for loop, looping through the children of the object "model"(You would have to change that") if v:IsA("Hat") then --If the ClassName of the current child == "Hat" v:Destroy() --Destroy the current child end end |
|
|
| Report Abuse |
|
|
Kyuro
|
  |
| Joined: 03 Sep 2012 |
| Total Posts: 5800 |
|
|
| 14 May 2014 07:22 AM |
| TY for the further explanation, I understand now :D |
|
|
| Report Abuse |
|
|