X2Bag
Globals
X2Bag
X2Bag
Classes
Class: X2Bag
Method: Capacity
(method) X2Bag:Capacity()
-> capacity: number
Returns the total capacity of the player’s bag.
@return
capacity— The maximum number of items the bag can hold.
Method: ItemStack
(method) X2Bag:ItemStack(slot: number)
-> itemStack: number
Returns the current stack size of the item in the specified bag slot.
@param
slot— The bag slot index. (min:1)@return
itemStack— The number of items in the stack.
Method: MoveToEmptyBankSlot
(method) X2Bag:MoveToEmptyBankSlot(slotIdx: number)
Moves an item from the bag to an empty bank slot. Cooldown 200ms.
@param
slotIdx— The bag slot index to move from. (min:1, max:150)
Method: GetBagItemInfo
(method) X2Bag:GetBagItemInfo(bagId: 1, slot: number, neededInfo?: `IIK_CATEGORY`|`IIK_CONSUME_ITEM`|`IIK_GRADE_STR`|`IIK_GRADE`|`IIK_IMPL`...(+5))
-> bagItemInfo: ItemInfo|nil
Retrieves item information for the specified slot if it exists.
@param
bagId— The bag ID.@param
slot— The slot to query. (min:1)@param
neededInfo— Optional additional information for the item.@return
bagItemInfo— The item information, ornilif the slot is empty or doesn’t exist.bagId: | 1 -- api/X2Item -- Values can be added together to get more information. neededInfo: | `IIK_CATEGORY` | `IIK_CONSUME_ITEM` | `IIK_GRADE` | `IIK_GRADE_STR` | `IIK_IMPL` | `IIK_NAME` | `IIK_SELL` | `IIK_SOCKET_MODIFIER` | `IIK_STACK` | `IIK_TYPE`See: ItemInfo
Method: CountItems
(method) X2Bag:CountItems()
-> itemCount: number
Returns the total number of items in the player’s bag.
@return
itemCount— The total count of items currently in the bag.
Method: EquipBagItem
(method) X2Bag:EquipBagItem(slot: number, isAuxEquip: boolean)
Attempts to equip an item from the specified slot.
@param
slot— The slot containing the item to equip. (min:1)@param
isAuxEquip— Whether to equip as auxiliary equipment.
Method: MoveToEmptyCofferSlot
(method) X2Bag:MoveToEmptyCofferSlot(slotIdx: number)
Moves an item from the bag to an empty coffer slot. Cooldown 200ms.
@param
slotIdx— The bag slot index to move from. (min:1, max:150)