VINDICTA
Misc · Function
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

messagebox

Displays a Windows message box and returns the user's response.

function messagebox(text: string, caption: string, flags: number): number

Synopsis

How it works

Calls the Win32 MessageBoxA API directly:
int result = MessageBoxA(
  robloxHWND,   // parent window handle
  text,         // body text (LPCSTR)
  caption,      // title bar text (LPCSTR)
  flags         // MB_* bitmask
);
return result;  // IDOK=1, IDCANCEL=2, IDYES=6, IDNO=7, ...
The flags parameter is a bitmask combining button and icon constants:
FlagValueEffect
MB_OK0x00OK button only
MB_OKCANCEL0x01OK + Cancel
MB_YESNO0x04Yes + No
MB_ICONWARNING0x30Warning triangle icon
MB_ICONERROR0x10Red X icon
Combine with bitwise OR: MB_YESNO + MB_ICONWARNING = 0x34.

Blocking behavior

MessageBoxA creates a modalModal dialogA window that blocks interaction with its parent window until dismissed. MessageBoxA() creates a modal dialog — the Luau thread is suspended until the user clicks a button. dialog and enters its own Win32 message loop. The Luau thread is blocked until the user clicks a button. Roblox continues rendering (the dialog is a separate window), but your script execution is paused. Use sparingly — it interrupts gameplay and can trigger AFK detection.

Usage

Confirm dialog
local MB_OKCANCEL = 0x1
local IDOK = 1
local result = messagebox("Continue?", "Confirm", MB_OKCANCEL)
if result == IDOK then
	print("User clicked OK")
end

Parameters

text string
Body text of the dialog.
caption string
Title bar text.
flags number
Win32 MB_ flag combination (buttons + icon).

Returns

number Win32 IDBUTTON constant of the clicked button.
Yields
This function yields until the dialog is closed. Do not call it inside critical game loops.