Skip to content

ui

The ui namespace enables scripts to build interactive menu components, find and override native cheat settings, and structure layouts with gears and inline switches.


local groupbox = ui.find(tab: string, groupbox: string) --> groupbox_t | nil
local element = ui.find(tab: string, groupbox: string, widget: string, widget_type?: number) --> ui_element_t | nil

Locates an existing native or script-created menu control.

  • If not found, logs an error to the console and returns nil.
  • widget_type is an optional integer disambiguator (see Widget Types).
local element = ui.find_silent(tab: string, groupbox: string, widget?: string, widget_type?: number) --> ui_element_t | nil

Identical to ui.find, but returns nil without logging an error upon a miss. Ideal for feature probing.

local menu_visible = ui.is_open() --> boolean

Returns true if the cheat menu is currently open on screen.

local keybinds = ui.get_binds() --> table of ui_element_t

Returns a 1-based table of all active keybind widgets registered in the menu.


local tab_handle = ui.tab(name: string, icon?: string)

Creates a top-level tab in the cheat menu navigation bar. icon defaults to the scripts icon if omitted.

local gb = ui.groupbox(tab: string, name: string) --> groupbox_t

Creates a groupbox container inside the specified tab.


Call these methods on a groupbox_t instance using colon notation (:):

Method Parameters Returns Description
gb:checkbox name: string, default?: boolean ui_element_t Boolean toggle switch.
gb:slider_int name: string, min: number, max: number, default: number, format?: string ui_element_t Integer slider (format e.g. "%d px").
gb:slider_float name: string, min: number, max: number, default: number, format?: string ui_element_t Float slider (format e.g. "%.2f").
gb:combo name: string, ...options: string ui_element_t Single-choice dropdown combo.
gb:multicombo name: string, ...options: string ui_element_t Multi-choice dropdown with checkboxes.
gb:listbox name: string, ...options: string ui_element_t Single-choice scrolling listbox.
gb:listbox_multi name: string, ...options: string ui_element_t Multi-choice scrolling listbox.
gb:color_picker name: string, default?: color ui_element_t RGBA color picker.
gb:keybind name: string ui_element_t Hotkey binder (hold / toggle / always).
gb:input name: string ui_element_t Single-line text input field.
gb:button name: string ui_element_t Clickable action button.
gb:label name: string ui_element_t Static text label.

Method Returns Description
el:get() any Returns the current active value based on widget type.
el:get(index: number) boolean Required for multicombo / multi-listbox: Returns whether 0-based option is checked.
el:set(value: any) nil Sets the value programmatically. Does not fire callbacks (except on combos).
el:set(value: boolean, index: number) nil Sets option state for multicombo / multi-listbox.
el:override(value?: any) nil Sets a runtime-only override for get(). Pass nil or no arguments to clear overrides.
el:override(value?: boolean, index?: number) nil Sets or clears runtime override for a multicombo / multi-listbox option.
el:set_callback(fn: function) nil Registers a callback triggered whenever the widget value changes in the menu.
el:visible(shown: boolean) nil Toggles widget visibility in the groupbox.
el:update_list(options: table) nil Replaces available options in combo and listbox elements.
el:type() number Returns the numeric widget type ID.
el:get_name() string Returns current label text.
el:set_name(text: string) nil Updates the displayed label text.
el:get_mode() number Keybind only: 0 (Hold), 1 (Toggle), 2 (Always on).
el:get_key() number Keybind only: Virtual key code.
el:add_gear_item(child: ui_element_t) ui_element_t Moves child into this element’s gear popup panel (chainable).
el:add_switch(checkbox: ui_element_t) ui_element_t Attaches a checkbox as an inline switch on the far left side of this row.

Type ID Widget Type el:get() Return Value el:set() Parameter
0 Checkbox boolean boolean
1 Slider (int) number number
2 Slider (float) number number
3 Keybind boolean (is active) boolean (toggle mode)
4 Label string string
5 Color picker color color
6 Combo number (0-based option index) number
7 List box number (0-based selected row) number
8 Multi-combo boolean (requires 0-based index) boolean, index
9 Button nil N/A
10 Input string string
11 Any (query filter) N/A N/A
12 Multi-listbox boolean (requires 0-based index) boolean, index