Skip to content

ui

The ui namespace. Nyx Lua API v1.

ui.toggle(id: string, label: string, default: boolean?) -> Control

A switch on the script's card.

ui.slider_int(id: string, label: string, min: number, max: number, default: number?) -> Control

A whole-number slider.

ui.slider_float(id: string, label: string, min: number, max: number, default: number?, decimals: number?) -> Control

A decimal slider.

ui.combo(id: string, label: string, items: {string}, default: number?) -> Control

One choice of items; get returns its 1-based index.

ui.multi_combo(id: string, label: string, items: {string}, defaults: {boolean}?) -> Control

Any number of items; get returns a list of booleans.

ui.color(id: string, label: string, default: number?) -> Control

A colour picker; get returns a packed colour.

ui.keybind(id: string, label: string) -> Control

A key the user binds (hold/toggle/always); get returns whether it is active.

ui.text_input(id: string, label: string, default: string?, max_len: number?) -> Control

One line of text (max_len 1-256).

ui.button(id: string, label: string, on_click: () -> ()) -> Control

A button; on_click runs on the next frame.

ui.label(text: string) -> Control

A line of text.

ui.separator() -> Control

A divider.

ui.window(id: string, title: string, size: vector) -> Window

A HUD window the user can drag; draw in its on_paint.

ui.sidebar(title: string?, icon: string?) -> (string, string)

The script's tab at the foot of the sidebar: a title (one line, 32 bytes; empty = the file name) and a Font Awesome 7 Free solid icon name. nil keeps a value; returns the title and icon in effect. An unknown icon falls back to file-code with a console warning.

ui.get(key: string) -> (number | string)?

A Nyx setting by config key (e.g. ESP.Box); booleans read as 0/1. An edit in the menu reads back once the menu closes. Keys under Script., Bind., Tab., Chat., Menu., HudPos. and Skin. are refused (an error), as for ui.override.

ui.override(key: string, value: boolean | number | string) -> ()

Overrides a Nyx setting while the script runs; never saved, undone on unload.

ui.clear_override(key: string) -> ()

Gives a setting back to the user.