ReferenceMiscellaneous

messagebox

Shows an Apex dialog and waits for a button choice.

Syntax

messagebox(text: string?, caption: string?, flags: number?) -> number

Also available as

message_box

Parameters

ParameterTypeDescription
textstring?Dialog message.
captionstring?Dialog heading.
flagsnumber?Button-layout flags; defaults to 0.

Returns

TypeDescription
numberChosen button identifier.

Description

The current task yields while the user responds. Text and caption default to empty strings; flags defaults to 0. The low four flag bits select layouts 0–5: OK, OK/Cancel, Abort/Retry/Ignore, Yes/No/Cancel, Yes/No, or Retry/Cancel. Results use the corresponding button identifiers: 1 OK, 2 Cancel, 3 Abort, 4 Retry, 5 Ignore, 6 Yes and 7 No.

Another pending dialog, unsupported layout, oversized text or an ended game session can raise an error. This is not a blocking operating-system alert or a second launcher window.

Example

local answer = messagebox("Continue this test?", "Example", 4)
if answer == 6 then print("Yes") end

These are Game executor contracts. Check build requirements and session lifetimes before using them.