This documentation is for developers who are making scripts for vorp core framework

Exports


These exports are client side only!

Getters

These exports are server side only!

Getters

Setters


Events

Server Side only

Listen to when an item is used

AddEventHandler("vorp_inventory:Server:OnItemUse",function(data)
    local source = data.source
    local itemName = data.item
end)

Listen to when an item is created in player inventory

OnItemCreated
AddEventHandler("vorp_inventory:Server:OnItemCreated",function(data,source)
    print(json.encode(data),{ident = true})
end)

Listen to when an item is removed from player inventory

OnItemRemoved
AddEventHandler("vorp_inventory:Server:OnItemRemoved",function(data,source)
    print(json.encode(data),{ident = true})
end)

Listen for inventory state change (opens or closes) including custom inventories

OnInvStateChange
AddEventHandler("vorp_inventory:Client:OnInvStateChange",function(boolean)
    print(boolean)
end)

STATEBAGS

contains data from the current weapon used in the inventory or last weapon used.

client side
GetEquippedWeaponData
local key = string.format("GetEquippedWeaponData_%d",weaponHash)
local data = LocalPlayer.state[key]
local serial = data.serialNumber
local id = data.weaponId
server side
GetEquippedWeaponData
local key = string.format("GetEquippedWeaponData_%d",weaponHash)
local data = Player(source).state[key]
local serial = data.serialNumber
local id = data.weaponId

check if inventory is active (open or closed) including custom inventories

client side
IsInvActive
LocalPlayer.state.IsInvActive
server side
IsInvActive
Player(source).state.IsInvActive