AnhRulzz
|
  |
| Joined: 26 Aug 2012 |
| Total Posts: 5 |
|
|
| 26 Jan 2014 05:46 PM |
I am not good at scripting can someone help me out?
FULL TITLE Hi how do you make a script that only lets you have one tool/gear in your backpack? |
|
|
| Report Abuse |
|
|
AnhRulzz
|
  |
| Joined: 26 Aug 2012 |
| Total Posts: 5 |
|
| |
|
|
| 27 Jan 2014 05:47 PM |
Get the number of tools in backpack If more than one then delete |
|
|
| Report Abuse |
|
|
AnhRulzz
|
  |
| Joined: 26 Aug 2012 |
| Total Posts: 5 |
|
|
| 27 Jan 2014 08:55 PM |
| I want to make a script that automatically deletes the old tool and replaces it with a new tool. For example, if you pick up a rocket then you get the rocket. You walk and pick up a sword. The rocket is deleted from your inventory and the sword gets added. I want it so players only get no more than one tool. PM me on RYANLEWLS or answer this forum. please. |
|
|
| Report Abuse |
|
|
AnhRulzz
|
  |
| Joined: 26 Aug 2012 |
| Total Posts: 5 |
|
| |
|
|
| 28 Jan 2014 08:46 AM |
p = game.Players.LocalPlayer bp = player.Backpack
oldTools = bp:GetChildren()
bp.ChildAdded:connect(function(newtool) for i=1,#oldTools do oldTools[i]:Destroy() oldTools = {newtool} end) |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2014 08:53 AM |
Game.Players.LocalPlayer.Backpack.ChildAdded:connect(fuction(New) if New:IsA("Tool") then for _, Tool in pairs (Game.Players.LocalPlayer.Backpack:GetChildren()) do if Tool:IsA("Tool") and Tool ~= New then Tool:Destroy() end end for _, Object in pairs (Game.Players.LocalPlayer.Character:GetChildren()) if Object:IsA("Tool") and Object ~= New then Object:Destroy() end end end end) |
|
|
| Report Abuse |
|
|
AnhRulzz
|
  |
| Joined: 26 Aug 2012 |
| Total Posts: 5 |
|
|
| 28 Jan 2014 02:06 PM |
| Wow thanks! I'll test them later |
|
|
| Report Abuse |
|
|