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: What does this do?

Previous Thread :: Next Thread 
Baluar is not online. Baluar
Joined: 21 Dec 2013
Total Posts: 56
14 Feb 2014 05:12 PM
What does this code do?

for i, v in pairs(Backpack:GetChildren()) do
if v.className == "Tool" or v.className == "HopperBin" or v.className == "LocalScript" then
if v ~= script and v ~= Bin then
v:Remove()
end
end
end
for i, v in pairs(Character:GetChildren()) do
if v.className == "Tool" then
v:Remove()
end
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
14 Feb 2014 05:16 PM
"What does this code do?" -> Error.
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 05:17 PM
This removes everything in a player's backpack.

But Backack isn't Defined... make it;

for i,v in pairs(game.Players.PlayerName.Backpack:GetChildren()) do

or if you're trying to do this to all players;

for i,v in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
Report Abuse
Baluar is not online. Baluar
Joined: 21 Dec 2013
Total Posts: 56
14 Feb 2014 05:20 PM
I figured, so now that I have this done. How would I make it where when they selected the tool then it'll remove the tool?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 05:23 PM
That would be a whole nother' script... something like;

game.Players.LocalPlayer.BackPack.ToolNem.Equipped:connect(function()
Report Abuse
Baluar is not online. Baluar
Joined: 21 Dec 2013
Total Posts: 56
14 Feb 2014 05:26 PM
How would this be setup? Would I put the too code in the same script? idk how to format this. D:
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
14 Feb 2014 05:38 PM
I can tell you barely know anything about Lua.. ugh :P
Report Abuse
Baluar is not online. Baluar
Joined: 21 Dec 2013
Total Posts: 56
14 Feb 2014 05:42 PM
Only very little basic stuff.
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