Client

GetItemList

exports["tgiann-inventory"]:GetItemList()

Return :

valuetype

Item list

table

Example

local allItems = exports["tgiann-inventory"]:GetItemList()

GetItemLabel

exports["tgiann-inventory"]:GetItemLabel(item)

Return :

valuetype

İtem label

string

Parameters :

NameTypeDescription

item

string

Item spawn name

Example

local label = exports["tgiann-inventory"]:GetItemLabel("bandage")

GetPlayerItems

exports["tgiann-inventory"]:GetPlayerItems()

Return :

valuetype

player items

table

Example

local playerItems = exports["tgiann-inventory"]:GetPlayerItems()

GetPlayerClotheItems

exports["tgiann-inventory"]:GetPlayerClotheItems()

Return :

valuetype

Player clothe items

table

Example

local playerClotheItems = exports["tgiann-inventory"]:GetPlayerClotheItems()

HasItem

exports["tgiann-inventory"]:HasItem(items, amount)

Return :

valuetype

Player has the item

boolen

Parameters :

NameTypeDescription

items*

table or string

The items to check, either a string, array of strings or a key-value table of a string and number with the string representing the name of the item and the number representing the amount

amount

int

The amount of the item to check for, this will only have effect when items is a string or an array of strings

Example

local has1 = exports["tgiann-inventory"]:HasItem("bandage", 2)
local has2 = exports["tgiann-inventory"]:HasItem({"bandage", "armor"}, 2)

OpenInventory

Same function as the F2(default) key

exports["tgiann-inventory"]:OpenInventory()

CloseInventory

exports["tgiann-inventory"]:CloseInventory()

SetInventoryActive

turns inventory usage off or on, when off, the player cannot open and use their inventory

exports["tgiann-inventory"]:SetInventoryActive(boolen)

ToggleHotbar

exports["tgiann-inventory"]:ToggleHotbar(isOpen)

Parameters :

NameTypeDescription

isOpen*

boolen

Opens the hotbar if true, closes it if false

Example

exports["tgiann-inventory"]:ToggleHotbar(true)
exports["tgiann-inventory"]:ToggleHotbar(false)

SetCanUseItem

turns off or on item usage in inventory, Player can't use items in their inventory when closed

exports["tgiann-inventory"]:SetCanUseItem(boolen)

IsInventoryActive

Returns the value modified with SetInventoryActive

local isActive = exports["tgiann-inventory"]:IsInventoryActive()

LastWeaponData

Returns the weapon in his hand and all weapons he uses within 30 seconds

local lastWeaponData, lastWeaponDataForDrop = exports["tgiann-inventory"]:LastWeaponData()

ResetWeaponDataForDrop

Within 30 seconds, resets the data of all weapons used

exports["tgiann-inventory"]:ResetWeaponDataForDrop()

GetCurrentWeapon

Get data for the currently equipped weapon

exports["tgiann-inventory"]:GetCurrentWeapon()

FastSlotAddItem

adds items to the fast slot. remember, if there is no item in your inventory, you cannot use the item in the fast slot

exports["tgiann-inventory"]:FastSlotAddItem(slot, itemName)

Parameters :

NameTypeDescription

slot*

number

Slot number for fast slot bar(max 5)

itemName*

string

item name

Example

exports["tgiann-inventory"]:FastSlotAddItem(1, "bandage")

FastSlotRemoveItem

removes the item from the fast slot

exports["tgiann-inventory"]:FastSlotRemoveItem(slot)

Parameters :

NameTypeDescription

slot*

number

Slot number for fast slot bar(max 5)

Example

exports["tgiann-inventory"]:FastSlotRemoveItem(1)

FastSlotRemoveAllSlots

Removes all items in the fast slot

exports["tgiann-inventory"]:FastSlotRemoveAllSlots()

Last updated