Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. function Self.Dequip(itemid, slot, container)
  2.     itemid = Item.GetItemIDFromDualInput(itemid)
  3.     if (not table.contains(EQUIPMENT_SLOTS, slot)) then
  4.         error(slot .. "' is not a valid slot.")
  5.         return false
  6.     end
  7.  
  8.     container = container or Container.GetFirst()
  9.     if (type(container) == 'number') then
  10.         container = Container.New(container)
  11.     end
  12.  
  13.     if (container:isOpen()) then
  14.         if (container:ItemCount() == container:Capacity()) then
  15.             return false
  16.         end
  17.         slotMoveItemToContainer(slot, container._index, container:Capacity() - 1)
  18.     else
  19.         return false
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement