generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Double GetChildren()

Previous Thread :: Next Thread 
Bloxmaster998144 is not online. Bloxmaster998144
Joined: 07 Sep 2009
Total Posts: 1188
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
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
03 Sep 2011 02:16 PM
v.Backpack:Remove()
end
Report Abuse
Bloxmaster998144 is not online. Bloxmaster998144
Joined: 07 Sep 2009
Total Posts: 1188
03 Sep 2011 02:18 PM
I don't want the whole backpack removed, only the tools inside it.
Report Abuse
Riderj is not online. 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 is not online. 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
Bloxmaster998144 is not online. Bloxmaster998144
Joined: 07 Sep 2009
Total Posts: 1188
03 Sep 2011 02:20 PM
Thank you, Rider.
Report Abuse
Crush47 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image