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
menu.add_toggle("Toggle ^_^", "toggle_global_key", true, false); -- Dot Operator
local menu_item = menu["get_item"]("toggle_global_key"); -- Bracket Operator

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.
add_label(string: name, boolean: safe?): boolean
name
string
required
The text to display for the label.
safe
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.
add_toggle(string: name, string: key, boolean?: default, boolean?: safe): boolean
name
string
required
The text label displayed next to the toggle switch in the menu.
key
string
required
The unique configuration key used to get and set the toggle’s boolean value via get_item and set_item.
default
boolean
The default value (initial state) for the toggle. Defaults to false.
safe
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.
add_slider_int(string: name, string: key, number?: default, number?: min, number?: max, boolean?: safe): boolean
name
string
required
The text label displayed next to the slider in the menu.
key
string
required
The unique configuration key used to get and set the slider’s integer value via get_item and set_item.
default
number
The default value (initial state) of the slider. Defaults to 0.
min
number
The minimum value the slider can be set to. Defaults to 0.
max
number
The maximum value the slider can be set to. Defaults to 100.
safe
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.
add_slider_float(string: name, string: key, number?: default, number?: min, number?: max, boolean?: safe): boolean
name
string
required
The text label displayed next to the slider in the menu.
key
string
required
The unique configuration key used to get and set the slider’s floating-point value via get_item and set_item.
default
number
The default value (initial state) of the slider. Defaults to 0.
min
number
The minimum value the slider can be set to. Defaults to 0.
max
number
The maximum value the slider can be set to. Defaults to 100.
safe
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.
add_single_combo(string: name, string: key, number?: default, table?: items, boolean?: safe): boolean
name
string
required
The text label displayed next to the single combo box in the menu.
key
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.
default
number
The initial 0-based index (initial state) of the single combo box. Defaults to 0 (the first item).
items
table
A Lua table (list) of strings defining the selectable options (e.g., {"Option A", "Option B"}). Defaults to an empty list.
safe
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.
add_multi_combo(string: name, string: key, table?: default, table?: items, boolean?: safe): boolean
name
string
required
The text label displayed next to the multi combo box in the menu.
key
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.
default
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.
items
table
A Lua table (list) of strings defining the selectable options (e.g., {"Option A", "Option B"}). Defaults to an empty list.
safe
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.
add_colorpicker(string: name, string: key, Color4?: default, boolean?: alpha, boolean?: inlayed): boolean
name
string
required
The text label displayed next to the color picker in the menu.
key
string
required
The unique configuration key used to get and set the colorpickers Color4 value via get_item and set_item.
default
Color4
The default color (initial state) for the picker. Defaults to a fully transparent black color (1, 1, 1, 1).
alpha
boolean
If true, the color picker will include an Alpha (transparency) slider. Defaults to true.
inlayed
boolean
If true, the color picker will be inlayed further down below the last widget. Defaults to false.

get_item

Get the value of a specific script configuration value.
get_item(string: key): any
key
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.
set_item(string: key, any: value): boolean
key
string
required
The unique string key of the configuration to set the value for.
value
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.
get_global(GlobalType: global, string: key): any
global
GlobalType
required
The global section to get the configuration value from.
key
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.
set_global(GlobalType: global, string: key, any: value): boolean
global
GlobalType
required
The global section to set the configuration value for.
key
string
required
The unique string key of the configuration to set the value for.
value
any
required
The new value to assign to the configuration. The value type must match the type of the configuration.
I