UI library reference

Build with Versus.

Controls, themes, saved settings, and examples for the Versus UI library.

23 sections

Load the Library

Loads the current Versus UI library from the server. Put this near the top of your script before creating any windows or sections.

-- Load the Library
local Library = loadstring(game:HttpGet("https://versusairlines.top/scripts/NewLibrary.lua"))()
Loads from the live library URL
Includes messages, bug reports, themes, and saved flags

Open the UI

Creates the main window and returns the controller used to add tabs, sections, and elements. This also creates the floating open/close button.

local ui = Library:Setup({
    Location = game.CoreGui,               -- parent for the ScreenGui
    OpenCloseLocation = "Top Center"       -- "Top Left" | "Top Center" | "Top Right"
                                           -- "Middle Left" | "Middle Right"
                                           -- "Bottom Left" | "Bottom Center" | "Bottom Right"
})

Tip: Set OpenCloseLocation if you want the floating button somewhere specific. The listed positions are supported.

Add a Section

Adds a section to the left side of the UI. Any elements created from that section will show in the main content area.

local versus = ui:CreateSection("Versus")
local airlines = ui:CreateSection("Airlines")

Label

Adds text to the UI. Use it for headings, dividers, notes, or small explanations between features. The special style gives it a cleaner Discord-like heading look.

versus:createLabel({
    Name = "hello world",
    Special = true,
})

-- You can now use :Set to change the title of a label!

-- granular control
versus:createLabel({
    Name = "Centered + rich",
    TransparentBackground = true,
    Center = true,
    Bold = true,
    Underline = true,
    Italic = true,
})

-- or pass your own RichText
versus:createLabel({
    Name = "ignored when Markup set",
    Markup = "<u><b><i>hello world</i></b></u>",
})

Button

Clickable action. Use it for one-off actions, or pass VersusAI = true to show the special Versus AI Pathing card.

versus:createButton({
    Name = "Vague Button",
    Description = "Needs 'Normal Toggle' active to respond.",
    Callback = function()
        if Library.Flags["Jimbo"] then
            print("Hello!!")
        else
            warn("Error: 'Normal Toggle' is off.")
        end
    end,
})

Toggle

A saved on/off switch. The value is stored in Library.Flags, so loops and other features can check it whenever they need to.

versus:createToggle({
    Name = "Normal Toggle",
    Flag = false,
    flagName = "Jimbo",
    Callback = function(v) print("Toggle:", v) end,
})

Slider

Lets the user pick a number between a minimum and maximum value. Useful for speed, delays, distances, amounts, and other tunable settings.

Set step = 5 for whole-number increments or step = 0.25 for decimal increments. Both libraries also accept Step, increment and Increment, in that order after step. Use one positive increment, with at most six decimal places. Values snap from minValue; the minimum and maximum remain reachable. Without a step, precision follows the bounds and default value, up to six decimal places; integer settings still change by 1.

Classic sliders include minus/plus buttons beside the editable value. Dragging, typing and these buttons use the same increment. Classic Special headings have a slim divider that fades at both ends.

versus:createSlider({
    Name = "Speed",
    Description = "WalkSpeed (1-100)",
    flagName = "Speed",
    value = 50, -- Default value
    minValue = 1,
    maxValue = 100,
    Callback = function(v)
        game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = v
    end,
})

Input Box

Lets the user type a custom value. The value saves when they press Enter, making it useful for numbers, player names, IDs, or raw settings.

versus:createInputBox({
    Name = "Jump Height",
    flagName = "Jump",
    Flag = 50,
    Callback = function(v)
        game.Players.LocalPlayer.Character.Humanoid.JumpHeight = tonumber(v)
    end,
})

Info and Warning Icons

Most elements can show small info or warning icons on the right. Use Description for extra details and Warning when a feature needs a clear heads-up.

versus:createToggle({
    Name = "God Mode",
    flagName = "GodMode",
    Description = "Makes you invincible (client-side).",
    Warning = function() return "Server anticheat may kick you." end,
    WarnIf  = function() return true end, -- return false to show a disabled icon
})

Info and warning popups use the same message box style as createDisplayMessage.

Display Message

Shows a clean popup message. Use it for confirmations, warnings, changelogs, errors, or anything that needs more attention than a small label.

Library:createDisplayMessage("Heads up",
    "Something changed behind the scenes.", {
      { text = "OK",   color = Color3.fromRGB(82,171,255) },
      { text = "More", color = Color3.fromRGB(120,120,120), callback=function() print("more") end },
    }, "info"
)

Bug Report Prompt

The report form requires context from the Versus loader. Standalone scripts without that context cannot submit a report; game scripts should use the existing form instead of collecting another key.

Opens the built-in report form in Classic or Modern after library setup. Launch through the updated Versus loader first: the form shows its current key as read-only, and reports cannot be sent without a loader key.

Library:PromptBugReport()

A summary and a short description are required. Use at least 3 words with 2 different words. A word is a whitespace-separated token containing ASCII letters; numbers and punctuation alone do not count. One report can be saved per validated key every 10 minutes, shared across the game-script and launcher forms.

Backspace/Esc or Cancel to close
Loader key is read-only
Required settings, saves and captured logs

Current feature flags and colour themes are captured from memory. Known save, theme and interface files that exist are attached automatically. Available Roblox output and real loader status/error history are included. Missing storage or log access is recorded honestly. An unreadable existing file, unavailable logs or an oversized diagnostic capture blocks submission; no fake messages or replacement files are created.

Text limits are 256 UTF-16 units for the summary and 4000 for the description. Diagnostics allow 300 KiB of UTF-8 JSON, each known file 256 KiB, and the decoded report 384 KiB. Server errors leave the form available for correction; a confirmed server response supplies the cooldown.

Loader integration

The loader calls Library:SetReportContext(context) before game controls initialize, including retry loads. The context supplies getKey, getDiagnostics, getCooldownUntil and setCooldownUntil callbacks tied to current loader state. Game scripts only need PromptBugReport(); do not ask users to enter a second report key or guess a shared global.

The launcher opens its own form with LauncherUI:PromptBugReport(context, sendReport). Its callback receives the current loader key, summary, description, game ID and diagnostic manifest, then uses the existing secure launcher transport. The server validates the key before saving a report. Diagnostics use version 1 with session, availability, flags, theme, logs and files.

Normalized, credential-redacted report descriptions and status are visible in the public bug inbox. Submitted descriptions and diagnostic attachments are restricted to the Versus staff panel, apart from the normalized public summary and description. Sensitive credentials are redacted before storage. Do not include passwords or unrelated private information in a description.

Themes and Customizer

Apply a complete preset or open Versus Forge to edit individual colour roles with HSV controls, exact hexadecimal values, live previewing, automatic text contrast, and named saved themes.

ui:UpdateUI("Custom")       -- apply the current custom theme
Library:OpenCustomizer()        -- open Versus Forge
Library:OpenForge()             -- alias of OpenCustomizer

-- Saved theme helpers:
Library:SaveCurrentThemeAs("My Cool Theme")
Library:OverwriteSavedTheme("My Cool Theme")

Colour roles: primary and secondary accents, window background, main and raised panels, button and input surfaces, sliders, borders, main text, muted text, and text drawn on accents.

Forge presets: Neon Command, Midnight, Ocean, Forest, Rose, and Light
Exact HSV, RGB, and #RRGGBB editing
Live changes are throttled while dragging
Current theme: Versus Airlines 2.0/modern-theme.json
Named themes: Versus Airlines 2.0/my_themes.json

Compatibility: themes saved before the extended colour roles were added are normalised when loaded. Special labels keep their transparent background and hidden stroke.

Seasonal themes and first-use setup

Seasonal appearance, reward availability and claim eligibility are managed by the loader and server. A theme alone does not indicate that a reward campaign is active.

The loader supplies validated seasonal configuration. Both libraries apply its accents over the user's base theme; saved and named themes remain unchanged. Clearing the event restores the base appearance. Game scripts do not fetch event settings or issue reward keys.

local ok, diagnostic = Library:SetSeasonalEvent(validatedView)
Library:SetSeasonalEvent(nil) -- clear the seasonal appearance

local reducedMotion = Library:GetReducedMotion()
Library:SetReducedMotion(true)
local disconnect = Library:OnReducedMotionChanged(function(enabled)
    -- Update optional interface animation when the preference changes.
end)

Library:OpenThemeChooser()
-- Call disconnect() when your listener is no longer needed.
  • SetSeasonalEvent(view) returns true for a valid configuration or an intentional clear. Invalid configuration clears the seasonal appearance and returns false, "invalid_seasonal_event". The loader manages event expiry.
  • GetReducedMotion() returns the current preference, including a session-only override. SetReducedMotion(value) enables it only for true and normally saves the choice. Pass false as the second argument, SetReducedMotion(value, false), to change it for this session without rewriting the saved preference.
  • OnReducedMotionChanged(callback) returns a disconnect function and runs the callback only when the preference changes. Registering another callback replaces the previous listener.
  • OpenThemeChooser() opens the preview and confirmation screen, with options to choose later or open the full customizer.

Global Config and Performance

The ModernLibrary Config page groups interface preferences, performance profiles, frame-rate controls, visual quality, and connection recovery in one place.

Interface: open/close keybind, floating-button visibility, and reduced motion
Profiles: Balanced, High Performance, Maximum FPS, and Restore Visual Quality
Frame rate: optional executor FPS limit and clearly labelled 60 FPS cap
Visual quality: shadows, materials, textures, particle density, post effects, terrain decoration, and local render distance
Recovery: auto rejoin and delay

Performance behaviour: world visuals are registered once and updated from a cache instead of repeatedly scanning the full Workspace. Character, camera, and Tool visuals are preserved. Individual properties are restored when their setting is disabled.

Natural quality: High Performance reduces ParticleEmitter density instead of deleting every effect. Colour correction is preserved, while the aggressive particle and texture options remain separately labelled.

Window Button and Navigation

The library creates a floating button for opening and closing the interface. Neon Command uses a labelled sidebar for dashboard, feature, Forge, Config, access, and update navigation.

  • Dashboard: session status, feature totals, performance, and quick actions
  • Features: game sections and their controls
  • Versus AI: opens the script's AI control when one is available
  • Forge: opens the complete colour theme editor
  • Config: opens interface, performance, and recovery settings
  • Key System and Updates: shows launcher-managed access and release information
-- Visibility flag for your loops:
if Library.isClosed then
    -- UI is currently visible
end

The isClosed field is a boolean you can read; it reflects the current main window visibility.

Saved Flags

Element values are kept inside Library.Flags. When the executor supports files, those values are saved per game so users keep their settings.

print(Library.Flags)            -- read everything
print(Library.Flags["Jimbo"])   -- read one flag
Folder: Versus Airlines 2.0/
Save file: saves.json (per-placeId)

Startup and restored callbacks

BeginInitialization(owner) must run before controls are created. Their effective saved values are available in Library.Flags, while callbacks and save writes wait until CompleteInitialization(owner). Complete only after the game inputs and every control are ready; check its returned success value. A failed build must call Cleanup(). Keep activation callbacks short and start recurring work through interval; completion dispatches saved callbacks but does not wait for every yielded callback to finish.

The owner is a table with an IsCurrent() method. CancelInitialization(owner) stops that owner's queued and tracked initialization callbacks; it does not clean unrelated game tasks. GetInitializationStatus() reports the current phase and callback counts. Cleanup() also cancels initialization and removes the library's UI and tracked connections.

Connections and Cleanup

Track each event listener under its feature tag. Use the shared interval helper for repeating work; use native events when they provide the change you need.

Library:TrackConnection(game.Players.PlayerAdded:Connect(function(player)
    if not runtime:IsCurrent() then return end
    print(player.Name)
end), "PlayerJoined")

Library:CleanupConnectionsByTag("PlayerJoined")
Library:Cleanup()

Disconnecting a connection stops future callbacks, but a callback that already yielded may still be running. The standalone starter owns and cancels its scheduler workers on cleanup. After any yielding operation, also recheck the interval's isCurrent(), the feature's current flag, the target and any relevant settings before taking another action. A new run loads the library again, which calls the previous library's cleanup first.

Sounds

Small click and pop sounds for UI feedback. They are off by default, so only enable them if the script needs sound feedback.

Library.DisableSounds = false
Library:PlaySound("Click")     -- also: "Pop"

Template: Toggle Loop

Use the starter's interval helper for recurring work. Reusing a tag replaces its connection and keeps an older yielded worker from overlapping its replacement.

versus:createToggle({
    Name = "Normal Toggle",
    Flag = false,
    flagName = "Jimbo",
    Callback = function()
        interval("AutoJimbo", "Jimbo", 0.1, function(_, isCurrent)
            if not isCurrent() or not Library.Flags["Jimbo"] then return end
            print("Normal Toggle is enabled")
        end)
    end,
})

The callback runs for both enable and disable changes, so calling interval unconditionally removes the old connection when the flag is off. The default minimum delay is 0.03 seconds; omit a delay for 0.1 seconds. Choose a cadence appropriate to the verified operation instead of polling every frame.

Template: Timed Heartbeat

The same helper handles slower checks. A yielded callback retains its worker slot until it returns. The scheduler waits while the library is building controls or activating saved settings.

versus:createToggle({
    Name = "Jimbo With Waiting",
    Flag = false,
    flagName = "waitJimbo",
    Callback = function()
        interval("AutowaitJimbo", "waitJimbo", 2, function(_, isCurrent)
            task.wait(0.1)
            if not isCurrent() or not Library.Flags["waitJimbo"] then return end
            print("Jimbo tick")
        end)
    end,
})

The short wait demonstrates the required post-yield checks; an actual feature should use its verified game operation and cooldown. The scheduler does not retry rejected native actions or infer success from a returned call. Refresh targets and relevant settings after a yield, and keep retry limits explicit.

Template: Refreshing Dropdown

Keeps a dropdown updated while the game changes. This example refreshes whenever players join or leave.

local dd = versus:createDropdown({
    Name = "Players",
    flagName = "PlayerDrop",
    List = {},
})
local function refresh()
    local names = {}
    for _,plr in ipairs(game.Players:GetPlayers()) do
        table.insert(names,plr.Name)
    end
    dd:updateList(names)
end
refresh()
Library:TrackConnection(game.Players.PlayerAdded:Connect(refresh),"PlayersDD")
Library:TrackConnection(game.Players.PlayerRemoving:Connect(refresh),"PlayersDD")