OPX//77
CreatorsClient exports

OpenForm

Last updated on

Opens an OPX form owned by your resource on the local player's screen.

local res = exports.opx_infinity:OpenForm(spec)

Sync. The submit or cancel reaches your reply export as opx:on:form:answer with the form's answer.

Parameters

  • spec: table — the form spec without owner/on
    • reply?: string — the export your answer goes to

Returns

  • { handle, id, fields }

Errors

  • form_busy (another form is open), spec errors, export.callerDenied, export.badArgument, error.unavailable (module not running)
Example
local res = exports.opx_infinity:OpenForm({
	title = 'Order',
	fields = { { id = 'qty', label = 'Quantity', slider = { min = 1, max = 10, step = 1 } } },
})

On this page

No Headings