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
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 14 Feb 2014 05:16 PM |
| "What does this code do?" -> Error. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 21 Dec 2013 |
| Total Posts: 56 |
|
|
| 14 Feb 2014 05:42 PM |
| Only very little basic stuff. |
|
|
| Report Abuse |
|
|