đŸ–Ĩī¸Server Exports

Server Exports for mInventory Remake Resource

HasItem

Gets the data if the player has the item or not.

-- source : player id
-- items :  items
-- amount : amount of items to check
exports['codem-inventory']:HasItem(source, items, amount)

AddItem

Adds item to inventory. There are two options for this export.

Option 1

-- source = Player id
-- item = item name
-- amount = amount of item
-- slot = slot number or nil
-- info = item info or nil
exports['codem-inventory']:AddItem(source, item, amount, slot, info)

Option 2

-- source = Player id
-- item = item name
-- amount = amount of item
exports['codem-inventory']:AddItem(source, item, amount)

RemoveItem

Removes item from inventory. There are two options for this export.

Option 1

-- source = player id
-- itemname = item name
-- amount = amount of item to remove
-- slot = slot of item to remove
exports['codem-inventory']:RemoveItem(source, itemname, amount, slot)

Option 2

-- source = player id
-- itemname = item name
-- amount = amount of item to remove
exports['codem-inventory']:RemoveItem(source, itemname, amount)

GetFirstsSlotByItem

Gets the item that in the first slot of the player inventory.

-- items : Player Inventory
-- itemname : Item name to search
exports['codem-inventory']:GetFirstSlotByItem(items, itemname)

GetItemsWeight

Gets the items weight.

-- items : Player Items
exports['codem-inventory']:GetTotalWeight(items)

GetItemByName

Gets the data of item by their name.

-- source : player id
-- name : item name
-- slot : item slot
exports['codem-inventory']:GetItemByName(source, name, slot)

SetItemBySlot

Sets the items slot in player inventory. " For Example : Water item is in the 4th slot of the player inventory, with this export you can move it to any slot you want. "

-- source : player id
-- slot : slot number
-- itemdata : new item data
exports['codem-inventory']:SetItemBySlot(source, slot, itemdata)

GetItemBySlot

Gets the items data according to their slot number.

-- source : player id
-- slot : slot number
exports['codem-inventory']:GetItemBySlot(source, slot)

SaveInventory

Saves the player inventory.

-- source : Player ID
-- offline : If the player is offline true else false
exports['codem-inventory']:SaveInventory(source, offline)

GetItemsByName

Gets the data of multiple items by their name.

-- source : player id
-- item : item name 
exports['codem-inventory']:GetItemsByName(source,item)

LoadInventory

Loads the player inventory. Think it like an restart as indivual inventories.

-- source : player id
-- identifier : player identifier or nil
exports['codem-inventory']:LoadInventory(source, identifier)

ClearInventory

Clears the player inventory entirely.

-- source : player id
exports['codem-inventory']:ClearInventory(source)

GetItemList

Gets all the items lists that is on the server.

exports['codem-inventory']:GetItemList()

GetInventory

Gets the data of players inventory.

-- identifier : player identifier
-- source : player id
exports['codem-inventory']:GetInventory(identifier, source)

CheckItemValid

Checks if the player has the valid inputed information in their inventory or not.

-- source : player id
-- name : item name
-- count : item count
exports['codem-inventory']:CheckItemValid(source, name, count)

GetItemLabel

Gets the item label.

-- itemname = itemname
exports['codem-inventory']:GetItemLabel(itemname)

GetStashItems

Gets the items on the stashes by their stash id.

-- stashid : stash name
exports['codem-inventory']:GetStashItems(stashid)

UpdateStash

Uptdates stash data.

-- stashid : stashid
-- item : new items
exports['codem-inventory']:UpdateStash(stasid, items)

GetItemsTotalAmount

Gets the item total amount that players has in their inventory.

-- source : player id
-- itemname : item name
exports['codem-inventory']:GetItemsTotalAmount(source, itemname)

SetInventoryItems

Sets the amounts for items that players has in their inventory.

-- source : player id
-- item : item name
-- amount : amount to set
exports['codem-inventory']:SetInventoryItems(source, item,amount)

SetItemMetaData

Sets the items meta data information.

-- source : player id
-- slot : slot number
-- metadata : new metadata

exports['codem-inventory']:SetItemMetadata(source, slot, metadata)

Last updated