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: Get Children Help.

Previous Thread :: Next Thread 
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:14 AM
How would i do this im trying to make a script that has a table of 5 tools names in it from backpack then below theirs a clear all the tools even if all the tools are not there it still removes which tools are there i have no clue on how to do so,
Report Abuse
cornytime is not online. cornytime
Joined: 07 Feb 2013
Total Posts: 3213
13 Jul 2014 12:16 AM
game.Players.PlayerName.Backpack:ClearAllChildren()
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:21 AM
i dont want to clear all children i need only the list of 5 ,
Report Abuse
6PenTax is not online. 6PenTax
Joined: 01 Sep 2010
Total Posts: 178
13 Jul 2014 12:22 AM
I don't understand the way you're expressing yourself.

Do you want to delete there 5 certain tools only?
Or the opposite?
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:25 AM
i only want to delete the tools out of the 5 tools not any of the rest.
Report Abuse
6PenTax is not online. 6PenTax
Joined: 01 Sep 2010
Total Posts: 178
13 Jul 2014 12:31 AM
Got it, here.

local player=Game.Players.LocalPlayer (Obviously a localscript)
local Tools={"Tool1","Tool2","Tool3","Tool4","Tool5"}

for _,v in pairs(player:WaitForChild("Backpack") do
for i=1,#Tools do
if v.Name:lower()==Tools[i]:lower() then
v:Destroy()
end end end
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:35 AM
this is underlined red

for _,v in pairs(player:WaitForChild("Backpack") do
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
13 Jul 2014 12:36 AM
ToolsToBeRemoved = {1,2,3,4,5}
for _,v in pairs(game.Players:GetChildren()) do
for _,i in pairs(ToolsToBeRemoved) do
if v.Backpack:FindFirstChild(i.Name) then
v.Backpack:FindFirstChild(i.Name):Remove()
end
end
end
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:36 AM
got it nvm
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:39 AM
this doesnt work :<



local player=Game.Players.LocalPlayer
local Tools={"Tool1","Tool2","Tool3","Tool4","Tool5"}
while wait(.1) do
for _,v in pairs(player:WaitForChild("Backpack")) do
for i=1,#Tools do
if v.Name:lower()==Tools[i]:lower() then
v:Destroy()
end end end end
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:41 AM
> AnonyAnonymous

it wont work.
Report Abuse
6PenTax is not online. 6PenTax
Joined: 01 Sep 2010
Total Posts: 178
13 Jul 2014 12:45 AM
._. It's the method I use for my tools, how can't it work? it's technically like saying if tool.classname="potato" then tool:destroy() end
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:48 AM
try it in studio is in in starter pack mine was in starter gui
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:49 AM
also im not removing tool's im removing local script's key down function's.
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 12:54 AM
bump
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
13 Jul 2014 01:05 AM
VV
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