One Studios
Client

Events

Client-side events.

Client-side events are emitted with TriggerEvent (client-local). Subscribe from any other client script.

For inventory state changes you can act on from your own resources, prefer the server-side Events: they fire once on the server and your code stays authoritative.

onInventoryUpdate

Fires whenever the local inventory mirror changes (item added, removed, swapped, used).

RegisterNetEvent('one_inventory:onInventoryUpdate', function(payload) end)
payload.slots
table<number, table>
Slot map, indexed by slot id.
payload.weight
number
Current carried weight in grams.
payload.maxWeight
number
Max carry weight in grams.

onItemCountChange

Fires once per item name whose total count changed in the latest sync.

RegisterNetEvent('one_inventory:onItemCountChange', function(payload) end)
payload.item
string
Item name.
payload.oldCount
number
Total before the change.
payload.newCount
number
Total after the change. 0 when every stack of the item was removed.

onItemUsed

Fires on the client when a UseItem flow completes successfully.

RegisterNetEvent('one_inventory:onItemUsed', function(payload) end)
payload.item
string
Item name used.
payload.slot
number
Slot the item was used from.
payload.metadata
table | nil
The item's metadata.

onWeaponChange

Fires when the locally-equipped weapon changes (equip or disarm).

RegisterNetEvent('one_inventory:onWeaponChange', function(payload) end)
payload.action
string
'equip' or 'disarm'.
payload.slot
number
Slot index of the weapon.
payload.weapon
string
Weapon item name.

onDefinitionsUpdated

Fires after any item-like definition (item, weapon, ammo, component, container, or clothing) is created, edited, or deleted from any source. Rapid bursts are coalesced into a single event.

AddEventHandler('one_inventory:onDefinitionsUpdated', function() end)
No payload. The client definition cache is already refreshed before this fires, so GetAllItemDefinitions / GetItemDefinition return fresh data inside the handler with no restart needed.