Advertisement
Cavitt

Resetting Backpacks

Apr 27th, 2012
1,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. --[[ USAGE: closeBackpacks() ]]--
  2.  
  3. function closeBackpacks()
  4.     while(true) do
  5.         local tempBP = Container:GetFirst()
  6.         if(tempBP:isOpen()) then
  7.             Self.UseItem(tempBP:ID())
  8.         else
  9.             break
  10.         end
  11.         wait(600, 1500)
  12.     end
  13. end
  14.  
  15.  
  16. --[[ USAGE: openBackpacks({id1, parentContainerIndex},{id2, parentContainerIndex}) ]]--
  17. --[[ SET parentContainerIndex TO WHATEVER BACKPACK YOU CAN FIND THE ID IN ]]--
  18.  
  19. function openBackpacks(...)
  20.     Self.UseItem(Self.Backpack().id)
  21.     wait(900, 1700)
  22.     for _, input in ipairs(arg) do
  23.         local Bp = Container.GetFromIndex(input[2])
  24.         for spot = 0, Bp:ItemCount() do
  25.             local item = Bp:GetItemData(spot)
  26.             if(item.id == input[1]) then
  27.                 Bp:UseItem(spot)
  28.                 break
  29.             end
  30.         end
  31.         wait(900, 1700)
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement