Skip to main content

Functions within the menu table (e.g., menu.add_toggle(), menu.add_slider()) are static registration calls used to define the user interface layout. You must not call these functions inside frequently executed events (like EventType.Draw or EventType.Tick). They should only be called once, at the very beginning of your script’s execution (on initialization or setup), to prevent instability and incorrect menu state.

Access

All menu C++ functions are exposed to your Lua script via a single global table named menu. You access individual values by using the dot (.) or bracket ([]) operator on this table.
Menu Usage Example

Functions

This section lists all available C++ functions exposed within the global menu table. These functions allow you to register new widgets (labels, toggles, sliders, etc.), retrieve configuration values, and directly manipulate the user interface elements.

add_label

Registers a non-interactive label or section divider in the menu. Returns a boolean indicating the success of the item creation.
string
required
The text to display for the label.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_toggle

Registers an interactive toggle switch widget in the menu. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the toggle switch in the menu.
string
required
The unique configuration key used to get and set the toggle’s boolean value via get_item and set_item.
boolean
The default value (initial state) for the toggle. Defaults to false.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_slider_int

Registers an interactive slider widget that allows selecting an integer value within a defined range. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the slider in the menu.
string
required
The unique configuration key used to get and set the slider’s integer value via get_item and set_item.
number
The default value (initial state) of the slider. Defaults to 0.
number
The minimum value the slider can be set to. Defaults to 0.
number
The maximum value the slider can be set to. Defaults to 100.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_slider_float

Registers an interactive slider widget that allows selecting an floating-point value within a defined range. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the slider in the menu.
string
required
The unique configuration key used to get and set the slider’s floating-point value via get_item and set_item.
number
The default value (initial state) of the slider. Defaults to 0.
number
The minimum value the slider can be set to. Defaults to 0.
number
The maximum value the slider can be set to. Defaults to 100.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_single_combo

Registers a single combo box widget that allows selecting a single item from a list of strings. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the single combo box in the menu.
string
required
The unique configuration key used to get and set the selected item’s index (as a number) via get_item and set_item.
number
The initial 0-based index (initial state) of the single combo box. Defaults to 0 (the first item).
table
A Lua table (list) of strings defining the selectable options (e.g., {"Option A", "Option B"}). Defaults to an empty list.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_multi_combo

Registers a multi combo box widget that allows the user to select multiple items from a list of strings. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the multi combo box in the menu.
string
required
The unique configuration key used to get and set the selected item indices (as a table of numbers) via get_item and set_item.
table
A Lua table (list) of numbers defining the initial 0-based indices (initial state) of the multi combo box (e.g., {0, 3, 4}). Defaults to an empty list.
table
A Lua table (list) of strings defining the selectable options (e.g., {"Option A", "Option B"}). Defaults to an empty list.
boolean
The safe status for the widget. If false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.

add_colorpicker

Registers a color picker widget that allows the user to choose an RGBA color. Returns a boolean indicating the success of the item creation.
string
required
The text label displayed next to the color picker in the menu.
string
required
The unique configuration key used to get and set the colorpickers Color4 value via get_item and set_item.
Color4
The default color (initial state) for the picker. Defaults to a fully white color (1, 1, 1, 1).
boolean
If true, the color picker will include an Alpha (transparency) slider. Defaults to true.
boolean
If true, the color picker will be inlayed further down below the last widget. Defaults to false.

add_notification

Registers a notification widget that allows the user to optionally click a button with a callback.
NotificationType | number
required
The identifier type to be displayed inside of the notification.
string
required
The title text label displayed inside of the notification.
string
The description text label displayed inside of the notification.
number
The time it takes for the notification to fade away in milliseconds.
string
The text label displayed inside of the button.
function
required
The Lua function to be executed when the button on the notification is clicked.

get_item

Get the value of a specific script configuration value.
string
required
The unique string key of the configuration to get the value from.

set_item

Set the value of a specific script configuration value. Returns a boolean indicating the success of the set.
string
required
The unique string key of the configuration to set the value for.
any
required
The new value to assign to the configuration. The value type must match the type of the configuration.

get_global

Get the value of a specific global configuration value.
GlobalType
required
The global section to get the configuration value from.
string
required
The unique string key of the configuration to get the value from.

set_global

Set the value of a specific global configuration value. Returns a boolean indicating the success of the set.
GlobalType
required
The global section to set the configuration value for.
string
required
The unique string key of the configuration to set the value for.
any
required
The new value to assign to the configuration. The value type must match the type of the configuration.