CreatorsClient exports
OpenMenu
Last updated on
Opens an OPX menu owned by your resource on the local player's screen.
local res = exports.opx_infinity:OpenMenu(spec)Sync. Every action on the menu reaches your reply export as opx:on:menu:action with the menu's action payload.
Parameters
- spec:
table— the menu spec without functionsowner,onandstealare set by OPX; any you pass are ignored.- Rows carry an
idyou read back asitemId. - A row with
confirm = true(or{ title, yes, no }) opens a two-row level, No, keep it first; your reply export gets the row'sselectonly after the second row. See Confirm rows. - reply?:
string— the export your answers go to; defaultCLIENT.EXPORTS.REPLY(OnOpxEvent)
Returns
{ handle, id, nodes }
Errors
menu_busy(another owner's menu is open), spec errors such asinvalid_items,export.callerDenied,export.badArgument,error.unavailable(module not running)
local res = exports.opx_infinity:OpenMenu({
title = 'NIGHT MARKET',
closeOnSelect = true,
items = {
{ id = 'water', label = 'Water', value = '5 €$' },
{ id = 'reset', label = 'Reset my stall', confirm = true },
},
})
if not res.ok then print('menu refused: ' .. res.error) end