Inventory

Allows interactions with the players inventory

Reference

Functions

Tables

Functions

impulse.Inventory.ClassToNetID(class)

View source »

Used to convert the class to the item's NetID (or table ref)

Parameters

Returns

impulse.Inventory.DBAddItem(ownerid, class[, storageType=1])

View source »

Inserts an inventory item into the database. This can be used to control the inventory of offline users

Parameters

impulse.Inventory.DBClearInventory(ownerid[, storageType=1])

View source »

Clears a players inventory. This can be used to control the inventory of offline users

Parameters

impulse.Inventory.DBRemoveItem(ownerid, class[, storageType=1[, limit=1]])

View source »

Deletes an inventory item from the database. This can be used to control the inventory of offline users

Parameters

impulse.Inventory.DBUpdateStoreType(ownerid, classname[, limit=1], oldStorageType, newStorageType)

View source »

Updates the storage type for an existing item. This can be used to control the inventory of offline users

Parameters

impulse.Inventory.GetCraftingTime(class)

View source »

Used to get the crafting time and the sounds to play

Parameters

Returns

impulse.Inventory.PickRandomCraftSound([craftType=generic])

View source »

Used to pick a random crafting sound for the correct crafting type

Parameters

Returns

See Also

impulse.Inventory.SpawnBench(class, pos, ang)

View source »

Spawns a workbench

Parameters

Returns

impulse.Inventory.SpawnItem(class, pos[, bannedPlayer[, killTime]])

View source »

Spawns an inventory item as an Entity

Parameters

Returns

impulse.RegisterBench(benchData)

View source »

Registers a new workbench

Parameters

impulse.RegisterItem(itemData)

View source »

Registers a new inventory item

Parameters

impulse.RegisterMixture(mixData)

View source »

Registers a new mixture

Parameters

meta:CanHoldItem(class[, amount=1])

View source »

Returns if a player can hold an item in their local inventory

Parameters

Returns

meta:CanHoldItemStorage(class[, amount=1])

View source »

Returns if a player can hold an item in their storage chest

Parameters

Returns

meta:CanMakeMix(class)

View source »

Returns if a player can make a mix

Parameters

Returns

meta:ClearIllegalInventory([storageType=1])

View source »

Clears illegal items from a players inventory

Parameters

meta:ClearInventory([storageType=1])

View source »

Clears a players inventory

Parameters

meta:ClearRestrictedInventory([storageType=1])

View source »

Clears restricted items from a players inventory

Parameters

meta:DropInventoryItem(itemid)

View source »

Drops a specific inventory item

Parameters

meta:GetInventory([storageType=1])

View source »

Gets a players inventory table

Parameters

Returns

meta:GetMaxInventoryStorage()

View source »

Returns the max capacity of the players storage box

Returns

meta:GiveInventoryItem(itemclass[, storageType=1[, restricted=false[, isLoaded=false[, moving=false[, clip]]]]])

View source »

Gives an inventory item to a player

Parameters

Returns

meta:HasIllegalInventoryItem([storageType=1])

View source »

Returns if a player has an illegal inventory item

Parameters

Returns

meta:HasInventoryItem(itemId)

View source »

Returns if a client has an inventory item and how much they have

Parameters

Returns

See Also

meta:HasInventoryItem(class[, amount=1])

View source »

Returns if a player has an item in their local inventory

Parameters

Returns

meta:HasInventoryItemSpecific(itemID[, storageType=1])

View source »

Returns if a player has an specific item. This is used to check if they have the exact item, not just an item of the class specified

Parameters

Returns

meta:HasInventoryItemStorage(class[, amount=1])

View source »

Returns if a player has an item in their storage chest

Parameters

Returns

meta:IsInventoryItemRestricted(itemID[, storageType=1])

View source »

Returns if a specific inventory item is restricted

Parameters

Returns

meta:MoveInventoryItem(itemid, from, to)

View source »

Moves a specific inventory item across storages (to move several of the same items use MoveInventoryItemMass as it is faster)

Parameters

meta:MoveInventoryItemMass(class, from, to, amount)

View source »

Moves a collection of the same items across storages

Parameters

meta:SetInventoryItemEquipped(itemID, state)

View source »

Sets a specific inventory item as equipped or not

Parameters

meta:TakeInventoryItem(itemID[, storageType=1[, moving=false]])

View source »

Takes an inventory item from a player

Parameters

Returns

meta:TakeInventoryItemClass(class[, storageType=1[, amount=1]])

View source »

Takes an item from a players inventory by class name

Parameters

meta:UnEquipInventory()

View source »

Un equips all iventory items for a player

meta:UseInventoryItem(itemid)

View source »

Uses a specific inventory item

Parameters

Tables

CraftingTypes

View source »

A collection of crafting types, each uses a different set of sounds

Fields