Menu tabs (UI)
Tabs of your own, sections in the built-in tabs, sub-tabs, widgets and HUD panels.
UI
Tabs of your own in the evasive menu, with sections and widgets. A widget's id is per script. Its value is saved next to the script (<script>.ui.json) and restored when the script runs again.
UI.AddTab(name, build)Adds a tab after Config. build(tab) runs every frame the overlay draws, menu open or not: it declares the tab's sections and widgets, and cannot yield. Up to 32 script tabs.
| Name | Type | Description |
|---|---|---|
name | string | |
build | function |
UI.AddTab("Helper", function(tab)
local opts = tab:Section("Options", "Left")
opts:Toggle("helper_on", "Turn on")
opts:SliderInt("helper_dist", "Distance", 10, 3000, 750)
end)UI.RemoveTab(name)Removes a tab. It also removes everything the script added to the menu tab of that name with UI.AddToTab.
| Name | Type | Description |
|---|---|---|
name | string |
UI.GetValue(id) -> anyA widget's value, from anywhere in the script.
| Name | Type | Description |
|---|---|---|
id | string |
any
if UI.GetValue("enabled") then endUI.SetValue(id, value)Sets a widget's value. A widget not made yet gets it when it is. Never runs callbacks.
| Name | Type | Description |
|---|---|---|
id | string | |
value | any |
UI.SetValue("range", 1000)UI.AddToTab(name, build) -> TabAdds sections to one of evasive's own menu tabs: Aim, Visuals, Misc, Players, Scripts or Config, in any case. build(tab) runs every frame, like the function of UI.AddTab. tab:Section puts a card on the tab's first page, under the tab's own cards. Calling AddToTab again for the same tab replaces build. Any other name is refused with a hint to use UI.AddTab.
| Name | Type | Description |
|---|---|---|
name | string | Aim, Visuals, Misc, Players, Scripts or Config. |
build | function | Called with the tab every frame. |
Tab
UI.AddToTab("Visuals", function(tab)
tab:Section("My ESP", "Left"):Toggle("my_glow", "Glow", false)
end)UI.AddPanel(name, build [, options]) -> PanelAdds a HUD panel. build(panel) runs every frame and fills it with rows. The panel shows while it has rows. An empty panel shows only while the menu is open, so the user can still place it. Panels can be dragged while the menu is open, and the position is saved. Panel names are case sensitive.
| Name | Type | Description |
|---|---|---|
name | string | The panel's name, unique per script. |
build | function | Called with the panel every frame. |
optionsoptional | table | style ("list" looks like the keybind list, "strip" like the watermark), title, icon, and the start position x and y. |
Panel
UI.AddPanel("Target", function(p)
p:Row("health", "87", { value_color = Color3.new(0, 1, 0) })
end, { style = "list", title = "target info", icon = "crosshair" })UI.RemovePanel(name)Removes a panel the script added.
| Name | Type | Description |
|---|---|---|
name | string |
UI.RemovePanel("Target")Tab:Section(name, side [, pages] [, maxHeight]) -> SectionA card in the "Left" or "Right" column. With pages it gets page buttons, and sec.page says which one is open. With maxHeight it scrolls.
| Name | Type | Description |
|---|---|---|
name | string | |
side | string | |
pagesoptional | { string } | |
maxHeightoptional | number |
Section
local sec = tab:Section("Aim", "Left", { "Main", "Advanced" })Tab:Subtab(name) -> SubtabA page of the tab. On a menu tab, one of its own page names puts sections on that page (Visuals: Players, Models, World, Radar. Misc: General, Overlay. Scripts: Scripts, Console, Settings). Any other name adds a new page after the built-in ones, on Visuals and Misc only. Aim, Players, Config and Scripts refuse a new page with an error. On a script tab it makes a sub-tab bar: tab:Section then lands on the first sub-tab, and the selected sub-tab is saved.
| Name | Type | Description |
|---|---|---|
name | string |
Subtab
UI.AddToTab("Misc", function(tab)
tab:Subtab("My page"):Section("Main", "Left"):Toggle("on", "On")
end)Subtab (UI)
What tab:Subtab returns (the UISubtab type). On a menu tab it is one of the tab's pages, built-in or new. On a script tab it is one sub-tab of the tab's sub-tab bar.
The sub-tab's name.
string
Subtab:Section(name, side [, pages] [, maxHeight]) -> SectionA card on this sub-tab, in the "Left" or "Right" column. It takes the same arguments as Tab:Section. Script cards go under the column's own cards, and the column scrolls when it runs out of room.
| Name | Type | Description |
|---|---|---|
name | string | |
side | string | |
pagesoptional | { string } | |
maxHeightoptional | number |
Section
UI.AddToTab("Visuals", function(tab)
tab:Subtab("Models"):Section("Extra", "Right"):SliderInt("r", "Range", 0, 100, 10)
end)Section (UI)
Widgets go into a section in the order they are declared. Every widget takes an optional callback last. It runs when the user changes the widget, never on SetValue.
The open page of a section made with pages, from 0.
number
if sec.page == 0 then
sec:Toggle("a", "A")
else
sec:Toggle("b", "B")
endSection:Toggle(id, label [, default] [, callback]) -> WidgetA checkbox.
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
defaultoptional | boolean | |
callbackoptional | function |
Widget
sec:Toggle("esp", "ESP", true, function(on) print(on) end)Section:Keybind(id [, key] [, mode] [, callback]) -> KeybindA key on the end of the toggle row above it. mode: "hold", "toggle", "always" or "click". No key and no mode means always on, and a key without a mode means "toggle". Left click rebinds it in the menu, right click picks the mode.
| Name | Type | Description |
|---|---|---|
id | string | |
keyoptional | (number | EnumItem) | |
modeoptional | string | |
callbackoptional | function |
Keybind
sec:Toggle("aim", "Aim")
local kb = sec:Keybind("aim_key", Enum.KeyCode.E, "hold")Section:SliderInt(id, label, min, max [, default] [, callback]) -> WidgetA whole-number slider.
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
min | number | |
max | number | |
defaultoptional | number | |
callbackoptional | function |
Widget
sec:SliderInt("fov", "FOV", 10, 800, 180)Section:SliderFloat(id, label, min, max [, default] [, format] [, callback]) -> WidgetA decimal slider. The format argument is a printf format such as "%.1f".
| Name | Type | Default | Description |
|---|---|---|---|
id | string | ||
label | string | ||
min | number | ||
max | number | ||
defaultoptional | number | ||
formatoptional | string | "%.2f" | |
callbackoptional | function |
Widget
sec:SliderFloat("smooth", "Smoothing", 0, 20, 6, "%.1f")Section:Combo(id, label, items [, default] [, callback]) -> ComboA drop-down. Its value is the index of the chosen item, counted from 0. The callback gets the index and the text.
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
items | { string } | |
defaultoptional | number | |
callbackoptional | function |
Combo
sec:Combo("part", "Target", { "Head", "Torso" }, 0)Section:Button(label [, width] [, height] [, callback]) -> WidgetA button. Pass width and height to size it.
| Name | Type | Description |
|---|---|---|
label | string | |
widthoptional | number | |
heightoptional | number | |
callbackoptional | function |
Widget
sec:Button("Reset", function() UI.SetValue("fov", 180) end)Section:ColorPicker(id [, r] [, g] [, b] [, a] [, callback]) -> WidgetA colour on the end of the toggle row above it, channels 0 to 1. Its value is a Color3 and the alpha, and the callback gets both.
| Name | Type | Description |
|---|---|---|
id | string | |
roptional | number | |
goptional | number | |
boptional | number | |
aoptional | number | |
callbackoptional | function |
Widget
sec:Toggle("box", "Box")
sec:ColorPicker("box_color", 1, 0, 0, 1)Section:ColorPair(id1, color1, id2, color2 [, callback]) -> WidgetTwo colours on the toggle row above, each {r, g, b, a}. The callback gets c1, a1, c2, a2.
| Name | Type | Description |
|---|---|---|
id1 | string | |
color1 | { number } | |
id2 | string | |
color2 | { number } | |
callbackoptional | function |
Widget
sec:ColorPair("vis", { 0, 1, 0, 1 }, "hid", { 1, 0, 0, 1 })Section:InputText(id, label [, default] [, callback]) -> WidgetA text field. The callback runs when it loses focus.
| Name | Type | Description |
|---|---|---|
id | string | |
label | string | |
defaultoptional | string | |
callbackoptional | function |
Widget
sec:InputText("name", "Name", "")Section:Text(text)A line of text.
| Name | Type | Description |
|---|---|---|
text | string |
Section:Tip(text)A tooltip on the widget above.
| Name | Type | Description |
|---|---|---|
text | string |
Section:Spacing()A gap.
The current value.
any
Widget:GetValue() -> anyThe current value (a ColorPair gives c1, a1, c2, a2).
any
Widget:SetValue(value)Sets the value. The callback does not run.
| Name | Type | Description |
|---|---|---|
value | any |
toggle:SetValue(true)true while the bind is active.
boolean
Keybind:IsEnabled() -> booleanThe same as .value.
boolean
if kb:IsEnabled() then endKeybind:GetKey() -> number | EnumItemThe bound key (an Enum.KeyCode item if it was given as one).
number | EnumItem
Keybind:SetKey(key)Binds another key.
| Name | Type | Description |
|---|---|---|
key | number | EnumItem |
kb:SetKey(Enum.KeyCode.Q)Keybind:GetKeyName() -> stringThe key's name in lower case: "f", "lmb", "rmb", "none", ...
string
Keybind:GetType() -> stringThe mode: "hold", "toggle", "always" or "click".
string
Keybind:SetType(mode)Changes the mode.
| Name | Type | Description |
|---|---|---|
mode | string |
kb:SetType("toggle")Keybind:ShowInKeybinds(label, toggleId)Lists the bind as label in evasive's keybind list (Misc > Panels) while the toggle toggleId is on.
| Name | Type | Description |
|---|---|---|
label | string | |
toggleId | string |
kb:ShowInKeybinds("Aim", "aim")Keybind:HideFromKeybinds()Takes it out of the keybind list.
Combo:Add(item)Adds an item.
| Name | Type | Description |
|---|---|---|
item | string |
Combo:Remove(item)Removes an item.
| Name | Type | Description |
|---|---|---|
item | string |
Combo:Clear()Removes every item.
Combo:GetItems() -> { string }The items.
{ string }
Combo:GetText() -> stringThe chosen item's text.
string
Combo:SetValue(index)Chooses the item at index, from 0.
| Name | Type | Description |
|---|---|---|
index | number |
Panel (UI)
What UI.AddPanel passes to its function (the UIPanel type). A HUD panel in the style of the keybind list or the watermark, which the user can drag while the menu is open.
Panel:Row(text [, value] [, options])Adds a row for this frame: text on the left, value on the right. options: color (the text), value_color, icon, and lit (the accent bar of the keybind list). Icons: show, keyboard, bomb, crosshair, target, skull, x, error, info, radar, tachometer, wifi, map, time, zap, or a codepoint number.
| Name | Type | Description |
|---|---|---|
text | string | |
valueoptional | string | |
optionsoptional | table | color, value_color, icon, lit. |
p:Row("speed", "16", { icon = "tachometer", lit = true })Panel:Title(text [, note])Sets the panel's title for this frame, with an optional dim note after it.
| Name | Type | Description |
|---|---|---|
text | string | |
noteoptional | string |
p:Title("target info", "3 players")Panel:Hide()Hides the panel for this frame.