OPX//77
CreatorsServer exports

RemoveFromStash

Last updated on

Takes items out of a stash.

local res = exports.opx_infinity:RemoveFromStash(stash, item, count, metadata)

Scope write · must be awaited — a synchronous call answers export.mustAwait before touching anything.

Parameters

  • stash: string

  • item: string

  • count?: integer

  • metadata?: table

  • stash is the storage key, 1–48 characters: letters, digits, _, -, ..

  • The stash is loaded, never opened in front of a player. One loaded this way and not opened by a player is saved and put away STASHES.IDLE_MS (60 s) after its last use.

  • count is 1–1 000 000, default 1; with metadata, only stacks with exactly that metadata match.

Returns

  • true

Errors

  • not_enough (also for a stash that does not exist; none is created), export.badArgument, inventory codes
Example
CreateThread(function()
  local pending, why = Open77.exports.call('opx_infinity', 'RemoveFromStash', 'my_shop.backroom', 'water', 1)
  if not pending then return print('not sent: ' .. tostring(why)) end
  local res = pending:await()
  if not (res and res.ok) then return print('refused: ' .. tostring(res and res.error)) end
  print('taken')
end)

On this page

No Headings