Client

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()

Last updated