OPX//77
opx_infinityinventory

Client

Last updated on

The inventory contract on the client — open the screen and read the last bag the server pushed.

local inventory = OPX.Api.Get('inventory')

From client code inside opx_infinity. Reads answer from the last bag the server pushed, never from what the screen predicts. Nothing yields. No function returns a Result.

Open

Opens the bag screen. Does nothing while down, dead or already opening.

inventory.Open()

Close

Closes the screen.

inventory.Close()

IsOpen

inventory.IsOpen()

Returns

  • boolean

GetInventory

The mirrored bag: same shape as the server's GetInventory value.

inventory.GetInventory()

Returns

  • table? — nil before the first push

GetItemCount

No metadata filter.

inventory.GetItemCount(name)

Parameters

  • name: string

Returns

  • integer — 0 before the first push

HasItem

inventory.HasItem(name, count)

Parameters

  • name: string
  • count?: integer

Returns

  • boolean
Example
if inventory.HasItem('lockpick') then --[[ show the row ]] end

GetItem

Same shape as the server's GetItem.

inventory.GetItem(name)

Parameters

  • name: string

Returns

  • table?

GetHeldWeapon

inventory.GetHeldWeapon()

Returns

  • { name, serial, slot } or nil

OpenStash

Asks to open a stash from STASHES. The server checks reach. A stash not in STASHES is refused.

inventory.OpenStash(name)

Parameters

  • name: string — the stash's NAME

On this page