ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. guiMessageBox

Function

guiMessageBox

ClientInterface (GUI)Trilogy Hub only

Shows a dialog with buttons. On click it fires onClientGUIAccepted (source: the window, arguments: the button text and its number), then the window closes.

Syntax

gui-window guiMessageBox(string title, string message [, table buttons = { "OK" }])

Arguments

titlestring
Title.
messagestring
Message.
buttonstable, optional = { "OK" }
Button labels.

Returns

The dialog window.

Example

local box = guiMessageBox("Sprzedaż", "Sprzedać auto za $5000?", { "Tak", "Nie" })
addEventHandler("onClientGUIAccepted", box, function(label, index)
    if index == 1 then
        triggerServerEvent("sellCar", localPlayer)
    end
end, false)