Single request
Theming, config saving and every widget live in one file. Libraries split into Library + ThemeManager + SaveManager pay three round trips before a menu appears.
A UI library for Roblox script hubs. One HTTP request, no image assets, and a reload guard so re-executing your script never stacks a second window.
local Library = loadstring(game:HttpGet("https://nm.nitaimaarek.com/lib"))()
Theming, config saving and every widget live in one file. Libraries split into Library + ThemeManager + SaveManager pay three round trips before a menu appears.
The same 24-control menu costs 269 Instances against 431 on the build it replaced. Dropdown rows and colourpicker panels are not built until opened, and only the things that need rounding get a UICorner.
Drag any edge or corner. North and west edges move the origin as they shrink, so the opposite corner stays put. Width snaps even so the content columns stay on whole pixels.
Every non-standard global (gethui, cloneref, getgenv, the file API) is probed and falls back. What your executor supports is reported on Library.Compat.
Window, tab, section, controls. Values live on Library.Options[flag].Value.
local Library = loadstring(game:HttpGet("https://nm.nitaimaarek.com/lib"))()
local Window = Library:CreateWindow({
Title = "my hub",
Subtitle = "v1.0",
ToggleKey = "Ctrl+H", -- set in code, not in the UI
Preset = "onyx", -- onyx | ice | midnight | carbon | comic | bubblegum | chalkboard
})
local Tab = Window:Tab("Main")
local Section = Tab:Section({ Name = "Combat", Side = "Left" })
Section:Toggle({
Flag = "aimbot",
Text = "Aimbot",
Default = false,
Callback = function(value)
print("aimbot:", value)
end,
})
Section:Slider({ Flag = "fov", Text = "FOV", Min = 10, Max = 500, Default = 120 })
-- read a value anywhere
if Library.Options.aimbot.Value then --[[ ... ]] end
The part most libraries get wrong. Executing your script a second time should replace the menu, not stack another one on top of it.
The guard runs before a single Instance is created, in three layers:
| Layer | What it does | Covers |
|---|---|---|
| Handoff | Calls Unload() on the previous instance held in getgenv().NMLib | The normal case. Disconnects everything and runs your cleanups. |
| Sweep | Scans gethui(), CoreGui and PlayerGui for a marker attribute and destroys any match | Executor wiped globals between runs but left the GUI alive. |
| Registry | Library:Connect / :Clean / :OnUnload track what your script made | Your loops and Instances, which the library cannot see otherwise. |
So the only rule: create connections through the library and it cleans up after you.
-- dies on reload, automatically
Library:Connect(RunService.Heartbeat, function() --[[ ... ]] end)
-- anything else you made
Library:Clean(myHighlight) -- Instance, connection, or function
Library:OnUnload(function() --[[ teardown ]] end)
PreserveState = true to CreateWindow and the previous run's values are re-applied
after the new UI is built. While iterating on a script your toggles and sliders stay where you left them instead of
resetting on every execution. Off by default so that changing a Default in your code actually takes effect.
The hide key and every keybind accept the same forms, including modifier combos.
-- all four are valid, anywhere a key is taken
"Ctrl+H"
"Ctrl+Shift+P"
Enum.KeyCode.RightShift
{ Enum.KeyCode.LeftControl, Enum.KeyCode.H }
Enum.UserInputType.MouseButton2
Matching is exact: a bare H bind does not fire while Ctrl is held, so H and Ctrl+H can coexist without stepping on each other. A modifier bound on its own still works — its own group is excluded from the exactness check.
Click the pill to rebind, right-click to cycle the mode, Escape to clear. While capturing, modifiers are held rather than committed, so pressing Ctrl then H records the combo. Releasing a modifier alone commits it as a plain bind.
| Mode | :GetState() returns |
|---|---|
"Hold" | true only while held; the callback also fires with false on release |
"Toggle" | flips on each press |
"Always" | always true |
Section:Keybind({ Flag = "aimkey", Text = "Aim", Default = "Ctrl+Shift+P", Mode = "Hold" })
Library:Connect(RunService.RenderStepped, function()
if Library.Options.aimkey:GetState() then -- aim end
end)
print(Library.Options.aimkey:GetKeyString()) --> "Ctrl+Shift+P"
Rebinding is silent — the callback is reserved for real presses and receives the resulting state, not the key.
Optional, draggable, and built out of named segments. Every segment is just a function returning a string, so the built-in counters and your own are the same thing.
local wm = Library:Watermark({ Separator = " | " })
wm:AddSegment("title", "nm hub", 1) -- a literal string
wm:AddSegment("fps", Library.Counters.fps, 2) -- a built-in
wm:AddSegment("ping", Library.Counters.ping, 3)
local kills = 0
wm:AddSegment("kills", function() -- anything you want
return kills .. " kills"
end, 4)
Renders as nm hub | 60 fps | 38 ms | 7 kills. A segment returning nil or an empty string is skipped, and a segment that errors is contained rather than taking the watermark down.
| Method | Notes |
|---|---|
:AddSegment(name, fn, order) | fn may be a function or a plain string. Lower order renders first. |
:RemoveSegment(name) | Drops one segment. |
:Set(value) | Clears everything and sets a single segment. |
:Clear() | Removes all segments. |
:SetSeparator(s) / :SetInterval(n) | Default " | " and 0.5 seconds. |
:SetVisible(b) / :SetPosition(u) | Draggable by default; pass Draggable = false to pin it. |
:Refresh() | Force an immediate rebuild. |
Library.Counters holds fps, ping, time, players and position. They are ordinary functions — call them yourself if you want the value rather than the label.
Library.FPS is the live frame rate if you want it elsewhere.
Dark monochrome, tight radii, hairline borders. Colour is reserved for state so the chrome stays quiet. Seven presets ship; everything is overridable.
Library:UsePreset("ice")
Library:SetTheme({ Accent = Color3.fromRGB(96, 178, 235) })
Library:SetFont("Ubuntu") -- ui, mono, bold families
SetTheme restyles everything already on screen, fonts included. Theme keys:
Accent AccentDim Background Surface Surface2 Surface3
Border BorderSoft Text SubText Dim
Success Warn Danger
Radius RadiusSm RadiusXs Stroke Inset
UI UIBold Mono LegacyUI LegacyBold LegacyMono
Radius = 0 no UICorner is created at all, which is where
some of the instance saving comes from. Corners that were built get re-rounded on a preset switch, but a build that
started flat cannot grow corners that never existed — so if you plan to switch presets live, start from a rounded one.
Roboto Regular via FontFace with an explicit weight, not the legacy Font enum —
the legacy path is what makes most menus look soft at 12–14px. Values and keybind pills are RobotoMono so
rows do not reflow as digits change width.
SetFont takes any Roblox family: Ubuntu, Nunito, RobotoCondensed,
ComicNeueAngular. Legacy Font equivalents are mapped for anywhere FontFace is unavailable.comic preset pairs Comic Neue Angular with Fredoka One for exactly this reason.0.5-scale column split lands on whole pixels. Text drawn at a
half-pixel offset is blurry regardless of the face.| Option | Type | Default | Notes |
|---|---|---|---|
Title | string | "nm hub" | Top-left title. |
Subtitle | string | nil | Mono text on the right of the title bar. |
Size | UDim2 | 620 × 450 | Width is rounded down to an even number. |
Position | UDim2 | centred | Scale is collapsed to offset at creation. |
ToggleKey | combo | RightShift | Any form from Keys. Code only, deliberately not in the UI. |
Preset | string | "onyx" | onyx | ice | midnight | carbon | comic | bubblegum | chalkboard. Applied before Theme and Accent. |
Theme | table | nil | Any theme keys to override at creation. |
Accent | Color3 | preset | Shortcut for Theme.Accent. |
Font / MonoFont | string | Roboto / RobotoMono | Roblox font family names. |
PreserveState | boolean | false | Re-apply the previous run's values after reload. |
Watermark | string | nil | Shortcut that creates a watermark with that title plus FPS. |
Animations | boolean | true | false replaces every tween with an instant set. |
MobileButton | boolean | true | Draggable toggle bubble, touch devices only. |
Layout | string | "topbar" | topbar | sidebar. |
Columns | number|string | "auto" | "auto" picks 1–3 by width, or force a fixed count. |
SidebarWidth | number | 132 | Tab column width, sidebar layout only. |
Resizable | boolean | true | Drag any edge or corner. false pins the size. |
Scale | number | 1 | Scales the whole menu, text included. Window:SetScale(n) at runtime. |
MinWidth / MinHeight | number | 420 / 300 | Resize floor. |
AutoShow | boolean | true | false starts hidden. |
Also accepts a plain string. Returns { Dismiss = function }. Works before CreateWindow.
Library:Notify({
Title = "Config",
Text = "saved",
Duration = 4,
Type = "success", -- info | success | warn | error
})
| Member | Notes |
|---|---|
Library.Options[flag] | Every element by flag. Library.Flags is the same table. |
Library.Compat | What the executor supports: cloneref, getgenv, HiddenGui, CoreGui, protect_gui. |
Library.FPS | Live frame rate, updated twice a second while a watermark exists. |
Library.Animations | Set false at any time to kill every tween. |
Library.Combo | .parse(v), .matches(combo, input), .display(combo) if you want your own binds. |
Library:Connect(sig, fn) | Connect and register for cleanup. |
Library:Clean(x) | Register an Instance, connection or function for teardown. |
Library:OnUnload(fn) | Run fn when the script reloads or unloads. |
Library:Unload() | Tear everything down now. |
Library:GetState() / :LoadState(s) | Serialise or restore every flag value. |
Library:SaveConfig(n) / :LoadConfig(n) | JSON under Library.ConfigFolder (default nm-lib). No-ops without a file API. |
local Tab = Window:Tab("Main")
local Section = Tab:Section({ Name = "Combat", Side = "Right" }) -- Left (default) | Right
Window:SetVisible(false)
Window:Toggle()
Window:SetToggleKey("Ctrl+Shift+M")
Window:SelectTab(Tab)
Window:SetLayout("sidebar")
Window:SetColumns(2) -- or "auto"
Call CreateWindow as many times as you like. Each window owns its position, size,
layout, column count, scale and hide key; they share the notification stack, the watermark and the icon set.
local main = Library:CreateWindow("nm hub")
local mini = Library:CreateWindow({
Title = "quick",
Size = UDim2.fromOffset(300, 230),
Position = UDim2.fromOffset(30, 90),
Layout = "sidebar",
Columns = 1,
ToggleKey = "Ctrl+J",
})
mini:SetScale(0.9) -- per window, does not touch the others
mini:Destroy() -- closes just this one
| Member | Notes |
|---|---|
Library.Windows | Every live window, in creation order. |
Library.Window | The most recently created one. Single-window scripts can keep using it. |
Window:Destroy() | Tears down one window, leaves the rest running. |
A window created without an explicit Position cascades 28px clear of the ones already
open, so a second window never lands exactly on the first.
Every control takes either a table or plain positional arguments. Same control, same result — pick whichever reads better where you are.
-- table form: every knob available
Section:Toggle({ Flag = "aim", Text = "Aimbot", Default = false, Callback = fn })
-- short form: text, values, callback
Section:Toggle("Aimbot", false, fn)
| Control | Positional form |
|---|---|
:Button | (text, callback) |
:Toggle | (text, default, callback) |
:Slider | (text, min, max, default, callback) |
:Dropdown | (text, values, default, callback) |
:Input | (text, placeholder, default, callback) |
:Keybind | (text, default, mode, callback) |
:Colorpicker | (text, default, callback) |
:Label | (text) |
Tab:Section | (name, side) |
Window:Tab | (name, icon) |
Library:CreateWindow | (title, subtitle) |
Trailing arguments can be skipped, and the callback is picked out wherever it lands —
:Toggle("Aimbot", fn) works as well as :Toggle("Aimbot", false, fn).
Without an explicit Flag, one is derived from the text by lowercasing and stripping
everything that is not a letter or digit, so :Toggle("Auto farm") is reachable as
Library.Options.autofarm. That is what makes the short form worth using rather than a
trap: values stay addressable.
duplicate, duplicate2) and warns in the console. Set Flag
explicitly when you care which is which — and always for anything you save to a config.
local Window = Library:CreateWindow("nm hub", "v1.0")
local farm = Window:Tab("Farm", "farm")
local auto = farm:Section("Auto")
auto:Toggle("Auto farm", false, function(on) print(on) end)
auto:Slider("Delay", 0, 5, 0.5)
auto:Dropdown("Mode", { "Closest", "Safest" }, "Closest")
auto:Button("Collect now", collect)
if Library.Options.autofarm.Value then --[[ ... ]] end
Nothing in the menu is allowed to end up on top of anything else by accident. Layers are declared, not inherited from creation order.
| Layer | Z | What sits there |
|---|---|---|
| Notify | 100 | toasts, always readable over everything |
| Watermark | 70 | above the window, below toasts |
| MobileButton | 60 | the touch toggle bubble |
| Chrome | 12 | header, tab strip, content |
| ResizeZone | 11 | the eight grab strips, under the content |
| Window | 10 | the window frame itself |
Two real bugs this fixed. Notifications were built before the window and both sat at the default
ZIndex, so sibling ordering drew the menu over the toasts. And the resize zones were pinned above
everything at ZIndex 20, spanning a strip inside every edge, which quietly swallowed clicks on any
control that reached the window border.
The grab strips are now exactly the width of Theme.Inset and sit below the content, so the
zone ends precisely where the content begins — adjacent, never overlapping.
Dropdowns and colourpickers expand inline, and only one may be open at a time: opening a second closes the
first, and switching tabs closes whatever was open rather than leaving it hanging on a hidden page. Opening one
scrolls its column far enough to show it instead of leaving it clipped. Query with element.Opened.
Z-order alone does not stop a toast from sitting on top of the menu, so the toast stack and the watermark are anchored to corners and kept apart:
Library:SetNotifyCorner("BottomRight") -- TopLeft | TopRight | BottomLeft | BottomRight
Library:SetWatermarkCorner("TopLeft")
Library.MaxNotifications = 5
MaxNotifications the oldest is retired, so a burst of toasts
can never grow tall enough to cover the window.UIPadding insets
every child of a frame, so a left pad shoves the rule inwards to exactly where the text begins and it
lands on the first characters. Those frames pad only on the right; the text block is placed clear of the rule by hand.
Pass an icon name as the second argument to Tab. Click any icon below to copy its name.
local farm = Window:Tab("Farm", "farm")
local combat = Window:Tab("Combat", "combat")
local misc = Window:Tab("Misc", "gear")
local plain = Window:Tab("Whatever", nil) -- no icon
-- the table form still works
Window:Tab({ Name = "Farm", Icon = "farm" })
nil, an omitted argument, or a name that does not exist all render a plain text tab — a typo
will never break a menu.
A thousand-icon set means uploaded rbxassetid images and a second HTTP fetch on every execution.
These are drawn instead from five primitives — line, dot, circle, filled rect, box — in a 0–100
coordinate box, so they cost nothing but the few bytes of their definition, tint with the theme like any other
frame, and stay crisp at any size. The trade is fidelity: line art, not detailed glyphs.
Library.Icons at build time and rendered to SVG with the same
five primitives the Roblox side draws with. What you see here is what the menu draws.
-- an uploaded asset, if you want a real image
Window:Tab("Shop", "rbxassetid://1234567")
-- or add your own vector to the set
Library.Icons.myicon = "L20 20 80 80|O50 50 30"
Window:Tab("Mine", "myicon")
-- render one anywhere
Library:RenderIcon(someFrame, "skull", { Size = 24, ColorKey = "Danger" })
| Op | Arguments | Draws |
|---|---|---|
L | x1 y1 x2 y2 | line with rounded caps |
D | cx cy r | filled dot |
O | cx cy r | circle outline |
F | x y w h | filled rect |
B | x y w h | box outline |
Each primitive is one Instance, so an icon costs between one and ten depending on its complexity.
Tabs across the top by default, with content columns that respond to the window width. Everything is positioned in whole-pixel offsets rather than scale.
Library:CreateWindow({
Layout = "topbar", -- topbar | sidebar
Columns = "auto", -- 1-3 by width, or force a number
})
Window:SetLayout("sidebar") -- both switch live
Window:SetColumns(2)
Sections are not pinned to a column. They flow into whichever is shortest, and the column count follows the content width, so a narrow window collapses instead of squeezing three columns into nothing.
| Content width | Columns |
|---|---|
| under 520px | 1 |
| 520 – 840px | 2 |
| 840px and up | 3 |
An explicit Side = "Left" or "Right" is honoured when there are exactly two columns,
and ignored otherwise — there is no sensible left or right in a one or three column grid.
Columns are sized in integer offsets computed from the window width, with the remainder absorbed by the last
column so they tile the content area exactly. A scale-based split (0.5, 0.333) lands on
fractional pixels the moment the width is not divisible by the column count, and fractional pixels are what makes
text look soft. The same applies to the header, tab strip and rules: all offsets, all recomputed on resize.
Window:ApplyLayout() recomputes every piece of chrome from the current window size. It runs at build
time, whenever a tab or section is added, and on every resize frame, so adding controls at runtime places them immediately.
Drag any edge or any corner. There are eight grab zones sitting on the border, half in and half out, plus a grip at the bottom right that is itself a handle, not a picture of one. Width always lands on an even number so the content columns stay on whole pixels.
Library:CreateWindow({
Resizable = true, -- default
MinWidth = 460,
MinHeight = 320,
})
Dragging a north or west edge moves the window origin as it shrinks, so the opposite corner stays put instead of walking across the screen.
The old build had rounded corners that looked broken, and it was structural rather than cosmetic:
ClipsDescendants clips to the rectangle, not the rounded shape. The window had both that and a
UICorner, so the full-width title bar, the sidebar divider and the content all rendered square
straight through the corner arc.UICorner has no per-corner radii. A full-width bar at the top of a rounded window can never round
only its top two corners, so it will always fight the frame it sits in.So the layout was rebuilt rather than re-tuned:
Theme.Inset, which is held greater than or equal to
Theme.Radius. The corner arc is pure background, so a rectangular clip has nothing to cut square.Radius for the window, RadiusSm for panels inside it,
RadiusXs for controls inside those. Equal radii make an inner corner look fatter than the one containing it.
Every element is created on a Section, takes a Flag to register itself under
Library.Options, and returns an object with
.Value, :SetValue(v, silent), :GetValue() and :OnChanged(fn).
| Element | Value type | Options |
|---|---|---|
:Button | — | Text, Callback |
:Toggle | boolean | Flag, Text, Default, Callback |
:Slider | number | Min, Max, Default, Decimals, Suffix |
:Dropdown | any / set | Values, Default, Multi. Also :SetValues(list, keep) |
:Input | string | Placeholder, Default, Numeric, Finished |
:Keybind | combo | Default, Mode. Also :GetState(), :GetKeyString() |
:Colorpicker | Color3 | Default |
:Label | — | Text, Muted, Mono, Wrap. Also :SetText(s) |
:Divider | — | — |
With Multi = true the value is a set, not a list, so membership is a direct lookup:
Section:Dropdown({
Flag = "parts", Text = "ESP parts",
Values = { "Box", "Name", "Tracer" },
Default = { "Box", "Name" },
Multi = true,
})
if Library.Options.parts.Value.Box then -- draw the box end
Lists expand inline and the section grows around them, so there is nothing to clip and no overlay to mis-position. Rows are built the first time a list is opened, not at load.
Nothing runs per frame unless a watermark exists, and that is one Heartbeat accumulator writing text twice a second. Dragging and sliders only do work while an input is held.
The hide key and every keybind share a single InputBegan handler rather than one connection per element.
Sizing is UIListLayout and AutomaticSize, so the engine reflows in C++ instead of Luau recomputing positions.
Parents to gethui() where available so the game cannot enumerate the GUI, falling back to CoreGui, then PlayerGui. Services are cloneref'd when the executor provides it.
Every element, combos, custom watermark segments, live theming, config saving and the reload guard. Run it twice to watch the window get replaced rather than duplicated.
loadstring(game:HttpGet("https://nm.nitaimaarek.com/example.lua"))()
--[[=========================================================================
nm-lib -- full feature demo
docs: https://nm.nitaimaarek.com
Execute this twice. The second run replaces the first: no duplicate
window, no leftover connections, and with PreserveState your toggles
stay where you left them.
=========================================================================]]
local Library = loadstring(game:HttpGet("https://nm.nitaimaarek.com/lib"))()
local Window = Library:CreateWindow({
Title = "nm hub",
Subtitle = "demo build",
Size = UDim2.fromOffset(620, 450),
ToggleKey = "Ctrl+H", -- combos work here; set in code, never in the UI
Preset = "onyx", -- onyx | ice | midnight | carbon | comic | bubblegum | chalkboard
PreserveState = true, -- keep values across re-executions
Layout = "topbar", -- topbar | sidebar
Columns = "auto", -- "auto" (1/2/3 by width) or a fixed 1-3
-- drag any edge or corner; the grip sits bottom-right
Resizable = true,
MinWidth = 420,
MinHeight = 300,
})
--=========================================================================
-- Watermark: every segment is yours to define
--=========================================================================
local watermark = Library:Watermark({ Separator = " | " })
watermark:AddSegment("title", "nm hub", 1)
watermark:AddSegment("fps", Library.Counters.fps, 2)
watermark:AddSegment("ping", Library.Counters.ping, 3)
-- ...and anything you want to count yourself
local kills = 0
watermark:AddSegment("kills", function()
return kills .. " kills"
end, 4)
--=========================================================================
-- Main
--=========================================================================
local Main = Window:Tab("Main", "home")
-- Both forms work everywhere. Use the table when you want every knob, the
-- short form when you do not.
local Combat = Main:Section("Combat", "Left")
Combat:Toggle({
Flag = "aimbot",
Text = "Aimbot",
Default = false,
Callback = function(value)
Library:Notify({
Title = "Aimbot",
Text = value and "enabled" or "disabled",
Type = value and "success" or "info",
Duration = 2,
})
end,
})
Combat:Keybind({
Flag = "aimkey",
Text = "Aim key",
Default = Enum.UserInputType.MouseButton2,
Mode = "Hold", -- Hold / Toggle / Always, right-click the pill to cycle
})
Combat:Keybind({
Flag = "panic",
Text = "Panic",
Default = "Ctrl+Shift+P", -- modifier combos
Mode = "Toggle",
Callback = function(state)
if state then
Library:Notify({ Title = "Panic", Text = "everything off", Type = "error" })
end
end,
})
Combat:Slider({
Flag = "fov",
Text = "FOV",
Min = 10,
Max = 500,
Default = 120,
Decimals = 0,
Suffix = "px",
})
Combat:Dropdown({
Flag = "hitpart",
Text = "Hit part",
Values = { "Head", "HumanoidRootPart", "UpperTorso" },
Default = "Head",
})
Combat:Divider()
Combat:Button({
Text = "Notify me",
Callback = function()
kills = kills + 1
Library:Notify({
Title = "nm-lib",
Text = "Buttons fire callbacks. Click a toast to dismiss it early.",
Duration = 4,
})
end,
})
local Player = Main:Section({ Name = "Player", Side = "Right" })
Player:Slider({
Flag = "walkspeed",
Text = "WalkSpeed",
Min = 16,
Max = 250,
Default = 16,
Callback = function(value)
local character = game.Players.LocalPlayer.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = value
end
end,
})
Player:Toggle({ Flag = "infjump", Text = "Infinite jump", Default = false })
-- Library:Connect registers the connection, so reloading kills it for you.
Library:Connect(game:GetService("UserInputService").JumpRequest, function()
if Library.Options.infjump.Value then
local character = game.Players.LocalPlayer.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end
end)
Player:Input({
Flag = "target",
Text = "Target player",
Placeholder = "username",
Finished = true, -- only fire on Enter
})
--=========================================================================
-- Visuals
--=========================================================================
local Visuals = Window:Tab("Visuals", "eye")
local Esp = Visuals:Section({ Name = "ESP", Side = "Left" })
Esp:Toggle({ Flag = "esp", Text = "Enabled", Default = false })
Esp:Dropdown({
Flag = "espparts",
Text = "Parts",
Values = { "Box", "Name", "Health", "Distance", "Tracer" },
Default = { "Box", "Name" },
Multi = true, -- Value is a set: { Box = true, Name = true }
})
Esp:Colorpicker({
Flag = "espcolor",
Text = "Colour",
Default = Color3.fromRGB(96, 178, 235),
})
Esp:Slider({
Flag = "esprange",
Text = "Max distance",
Min = 50,
Max = 2000,
Default = 500,
Suffix = "m",
})
local Look = Visuals:Section({ Name = "Appearance", Side = "Right" })
Look:Dropdown({
Flag = "preset",
Text = "Preset",
Values = { "onyx", "ice", "midnight", "carbon", "comic", "bubblegum", "chalkboard" },
Default = "onyx",
Callback = function(name)
Library:UsePreset(name)
end,
})
Look:Dropdown({
Flag = "font",
Text = "Font",
Values = { "Roboto", "Ubuntu", "Nunito", "RobotoCondensed", "ComicNeueAngular" },
Default = "Roboto",
Callback = function(family)
Library:SetFont(family)
end,
})
Look:Colorpicker({
Flag = "accent",
Text = "Accent",
Default = Color3.fromRGB(235, 236, 240),
Callback = function(color)
Library:SetTheme({ Accent = color })
end,
})
Look:Toggle({
Flag = "animations",
Text = "Animations",
Default = true,
Callback = function(value)
Library.Animations = value
end,
})
Look:Dropdown({
Flag = "layout",
Text = "Layout",
Values = { "topbar", "sidebar" },
Default = "topbar",
Callback = function(mode)
Window:SetLayout(mode)
end,
})
Look:Dropdown({
Flag = "columns",
Text = "Columns",
Values = { "auto", "1", "2", "3" },
Default = "auto",
Callback = function(value)
Window:SetColumns(tonumber(value) or "auto")
end,
})
Look:Toggle({
Flag = "watermark",
Text = "Watermark",
Default = true,
Callback = function(value)
watermark:SetVisible(value)
end,
})
--=========================================================================
-- Farm -- the second argument is the icon; nil or omitted means none
--=========================================================================
local Farm = Window:Tab("Farm", "farm")
local Auto = Farm:Section("Auto")
-- Short form: text, then values, then an optional callback. The flag is
-- derived from the text, so this is still Library.Options.autofarm.
Auto:Toggle("Auto farm", false, function(on)
print("farming:", on)
end)
Auto:Dropdown("Mode", { "Closest", "Highest value", "Safest" }, "Closest")
Auto:Slider("Delay", 0, 5, 0.5)
Auto:Button("Collect now", function()
Library:Notify("collecting")
end)
local Combat = Window:Tab("Combat", "combat")
Combat:Section("Targeting"):Toggle("Auto attack")
local Whatever = Window:Tab("Whatever", nil) -- no icon
Whatever:Section("Notes"):Label("Tabs work fine without an icon.")
--=========================================================================
-- Settings
--=========================================================================
local Settings = Window:Tab("Settings", "gear")
local Config = Settings:Section({ Name = "Config", Side = "Left" })
Config:Input({ Flag = "configname", Text = "Config name", Default = "default" })
Config:Button({
Text = "Save",
Callback = function()
local ok, err = Library:SaveConfig(Library.Options.configname.Value)
Library:Notify({
Title = "Config",
Text = ok and "saved" or ("failed: " .. tostring(err)),
Type = ok and "success" or "error",
})
end,
})
Config:Button({
Text = "Load",
Callback = function()
local ok, err = Library:LoadConfig(Library.Options.configname.Value)
Library:Notify({
Title = "Config",
Text = ok and "loaded" or ("failed: " .. tostring(err)),
Type = ok and "success" or "error",
})
end,
})
local About = Settings:Section({ Name = "About", Side = "Right" })
About:Label({ Text = "Hide the menu with Ctrl+H (set in code)." })
About:Label({ Text = "executor support:", Muted = true, Mono = true })
for feature, supported in pairs(Library.Compat) do
About:Label({ Text = (supported and "+ " or "- ") .. feature, Muted = not supported, Mono = true })
end
About:Divider()
About:Button({
Text = "Unload",
Callback = function()
Library:Unload()
end,
})
-- Anything the library did not create is your responsibility. Register it and
-- reloading cleans it up automatically.
Library:OnUnload(function()
print("[nm-lib] demo unloaded")
end)
--=========================================================================
-- A second, smaller window. Independent position, size, layout, scale and
-- hide key; it shares the notification stack and the watermark.
--=========================================================================
local Mini = Library:CreateWindow({
Title = "quick",
Size = UDim2.fromOffset(300, 230),
Position = UDim2.fromOffset(30, 90),
Layout = "sidebar",
Columns = 1,
MinWidth = 260,
MinHeight = 180,
ToggleKey = "Ctrl+J",
})
local Quick = Mini:Tab("Quick", "lightning")
local Actions = Quick:Section("Actions")
Actions:Button("Rejoin", function()
Library:Notify({ Title = "quick", Text = "rejoining", Type = "warn" })
end)
Actions:Toggle("Noclip", false)
Actions:Slider("FOV", 70, 120, 90)
-- overlays can be moved out of the way of either window
Library:SetNotifyCorner("BottomRight")
Library:SetWatermarkCorner("TopLeft")
Library:Notify({
Title = "nm hub",
Text = "Loaded. Ctrl+H for the main menu, Ctrl+J for quick.",
Type = "success",
})