Server items
Read registered item definitions and register new items from server-side resources.
Item exports
Access or extend the server item registry.
GetRegisteredItem(itemName)Returns one registered item definition.
itemNamestringServerItemGetRegisteredItems()Returns every registered item definition.
ServerItem[]RegisterItem(name, data)Registers an item for server-side use.
namestringdataServerItem—Item definition
widthnumberItem width in the inventory grid.
heightnumberItem height in the inventory grid.
isStackable?booleanAllows multiple items to share a stack.
tradable?booleanControls whether the item can be traded.
deletable?booleanControls whether the item can be deleted.
weight?numberWeight of one item.
formatName?stringDisplay name of the item.
bagSize?{ x: number; y: number }Grid size provided when the item is a bag.
propId?numberAssociated prop identifier.
clothingId?numberAssociated clothing identifier.
droppedModel?stringWorld model used when the item is dropped.
rarity?stringItem rarity name.
rarityColor?number[]Color assigned to the rarity.
description?stringItem description.
isBodyArmour?booleanMarks the item as body armour.
weaponHash?numberAssociated weapon hash.
generateSerial?booleanEnables serial number generation.
isAmmo?booleanMarks the item as ammunition.
isUsable?booleanMarks the item as usable. Automatically enabled when onUse is defined.
canPutOnSlotGUID?SlotGuids[]Lists the compatible equipment slots.
canPutOnSlot?booleanAllows the item to be placed in a slot.
onUse?functionRuns when the item is used.
onUseDeleteAmount?numberAmount removed when the item is used.
defaultMetaItemMetaDataDefault metadata assigned to new entries.
Register an item
Register a small backpack with clothing, storage and world-model settings.
exports["avp_grid_inventory"]:RegisterItem("small_backpack", {
height = 2,
width = 2,
weight = 5.0,
bagSize = {
x = 6,
y = 3
},
clothingId = 5,
defaultMeta = {
drawable = 31,
texture = 0
},
formatName = "Small Backpack",
droppedModel = "prop_cs_heist_bag_02",
canPutOnSlotGUID = { "BACKPACK_SLOT" }
})