|
| 03 Sep 2011 02:16 PM |
for i, v in pairs(game.Players:GetChildren()) do --...
Alright, I have the players. I want to get the children of their backpacks now, and remove those children. I'm not quite sure what to do next. Any help? |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Sep 2011 02:18 PM |
| I don't want the whole backpack removed, only the tools inside it. |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 03 Sep 2011 02:18 PM |
for _,d in pairs(v.Backpack:GetChildren()) do d:Remove() end |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 03 Sep 2011 02:20 PM |
actually
for i,d in pairs(v:GetChildren()) do if d.Name == "Backpack" then for i,l in pairs(d:GetChildren()) do l:remove() end end end
you would use three loops, one for the players children, one for the real player, then one for the backpack. |
|
|
| Report Abuse |
|
|
| |
|
Crush47
|
  |
| Joined: 17 Feb 2009 |
| Total Posts: 626 |
|
|
| 03 Sep 2011 02:50 PM |
for i,v in ipairs(game:GetService("Players"):GetChildren()) do pcall(function() for a,b in ipairs(v.Backpack:GetChildren()) do b:Remove() end end) end |
|
|
| Report Abuse |
|
|