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 » Scripters
Home Search
 

Re: Taking all tools from all players

Previous Thread :: Next Thread 
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
15 Jun 2015 08:23 AM
v is the player, tools is a table with tool names

it doesnt work

BUT IT HAS TO BE PUT IN PLAYER SO I CAN GIVE THEM BACK



if TakeTools == true then
for _,vv in ipairs(v.Backpack:GetChildren()) do
for _,vvv in ipairs(Tools) do
for _,vvvv in ipairs(v.Character:GetChildren()) do
if vv.Name == vvv then
vv.Parent = v
elseif vvvv.Name == vvv then
vv.Parent = v
end
end
end
end
end
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
15 Jun 2015 08:31 AM
Your loops are confusing. You don't need to do it like that. Also your variable names are confusing.

local takeToolsFromContainer = function (tools, player, container)
if (container == nil) then
return;
end
for _, obj in pairs(container:GetChildren()) do
for _, tool in pairs(tools) do
if (obj.Name == tool) then
obj.Parent = player;
end
end
end
end;

local takeTools = function (tools, player)
takeToolsFromContainer(tools, player, player.Backpack);
takeToolsFromContainer(tools, player, player.Character);
end;
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
15 Jun 2015 08:51 AM
Thanks droid. Would you like to see my finished code?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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