Examples

Complete Examples

Full examples showing how to use NexusUI's advanced features.

Download Complete Examples Bundle

Key System

Protect your script with a key system. Supports multiple keys, HWID lock, and remote validation.

Basic Key System
NexusUI:CreateKeySystem({
    Title = "My Script Hub",
    SubTitle = "Key System",
    Note = "Get your key from our Discord",
    Keys = {
        "FREE-KEY-2024",
        "PREMIUM-KEY-001",
        "VIP-ACCESS"
    },
    SaveKey = true,
    KeyFileName = "MyScriptKey",
    KeyLink = "https://discord.gg/yourserver",
    Discord = "https://discord.gg/yourserver",
    Theme = "Dark",
    Callback = function(hwid)
        print("Key validated! HWID: " .. hwid)
        LoadMainScript()
    end,
    CancelCallback = function()
        print("User cancelled")
    end
})
Remote Key Validation
NexusUI:CreateKeySystem({
    Title = "Secure Script",
    RemoteKeyCheck = true,
    RemoteKeyURL = "https://your-api.com/validate",
    RemoteKeyHWID = true,
    HWIDLock = true,
    SaveKey = true,
    Callback = function(hwid)
        LoadMainScript()
    end
})

Notifications

Display temporary messages to users.

Basic Notification
NexusUI:Notify({
    Title = "Success!",
    Content = "Feature enabled successfully",
    Duration = 5,
    Icon = "check"
})
Notification with Actions
NexusUI:Notify({
    Title = "Update Available!",
    Content = "A new version is available",
    SubContent = "Click to update",
    Duration = 0,  -- Don't auto-dismiss
    Icon = "download",
    Actions = {
        Update = {
            Name = "Update Now",
            Callback = function()
                -- Update script
            end
        },
        Later = {
            Name = "Later",
            Callback = function()
                -- Dismiss
            end
        }
    }
})

Dialogs

Show modal dialogs that require user interaction.

Confirmation Dialog
Window:Dialog({
    Title = "Confirm Action",
    Content = "Are you sure you want to proceed? This action cannot be undone.",
    Buttons = {
        {
            Title = "Yes, Continue",
            Callback = function()
                print("User confirmed")
            end
        },
        {
            Title = "Cancel",
            Callback = function()
                print("User cancelled")
            end
        }
    }
})

Config System

Save and load user configurations.

Config Setup
-- Set up save location
SaveManager:SetFolder("NexusUI/MyScript")
SaveManager:SetSubFolder("configs")

-- Save config
SaveManager:Save("MyConfig")

-- Load config
SaveManager:Load("MyConfig")

-- Delete config
SaveManager:Delete("MyConfig")

-- Get list of configs
local configs = SaveManager:GetConfigList()
Config Tab Example
local SettingsTab = Window:AddTab({Title = "Settings", Icon = "settings"})
local ConfigSection = SettingsTab:AddSection("Configuration")

local ConfigInput = ConfigSection:AddInput({
    Title = "Config Name",
    Placeholder = "Enter name..."
})

ConfigSection:AddButton({
    Title = "Save Config",
    Callback = function()
        local name = ConfigInput:GetValue()
        if name ~= "" then
            SaveManager:Save(name)
            NexusUI:Notify({
                Title = "Saved!",
                Content = "Config saved: " .. name,
                Duration = 3
            })
        end
    end
})

local ConfigDropdown = ConfigSection:AddDropdown({
    Title = "Load Config",
    Values = SaveManager:GetConfigList(),
    Placeholder = "Select..."
})

ConfigSection:AddButton({
    Title = "Load",
    Callback = function()
        local name = ConfigDropdown:GetValue()
        if name then
            SaveManager:Load(name)
        end
    end
})

Boot Animation

Show a beautiful loading screen before your UI appears.

Boot Animation
NexusUI:BootAnimation({
    Title = "My Script Hub",
    SubTitle = "Premium Edition",
    LogoId = "rbxassetid://123456789",
    Duration = 3,
    LoadingText = "Initializing...",
    Callback = function()
        -- Boot complete, create window
        local Window = NexusUI:CreateWindow({
            Title = "My Script Hub",
            Theme = "Cyberpunk"
        })
        
        -- Add tabs and elements...
    end
})

Complete Script Template

A full script template you can use as a starting point:

Script Template
-- Load NexusUI
local NexusUI = loadstring(game:HttpGet("https://nexusdevs.fun/nexus/nexuslib.lua"))()

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer

-- Settings
local Settings = {
    SpeedEnabled = false,
    SpeedValue = 16,
    JumpEnabled = false,
    JumpValue = 50
}

-- Create Window
local Window = NexusUI:CreateWindow({
    Title = "My Script Hub",
    SubTitle = "v1.0",
    Theme = "Dark",
    MinimizeKey = Enum.KeyCode.RightControl
})

-- Main Tab
local MainTab = Window:AddTab({Title = "Main", Icon = "home"})

-- Speed Section
local SpeedSection = MainTab:AddSection("Speed")

SpeedSection:AddToggle({
    Title = "Enable Speed",
    Default = false,
    Flag = "SpeedEnabled",
    Callback = function(Value)
        Settings.SpeedEnabled = Value
        local char = LocalPlayer.Character
        if char then
            local hum = char:FindFirstChildOfClass("Humanoid")
            if hum then
                hum.WalkSpeed = Value and Settings.SpeedValue or 16
            end
        end
    end
})

SpeedSection:AddSlider({
    Title = "Speed Value",
    Min = 16,
    Max = 100,
    Default = 16,
    Flag = "SpeedValue",
    Suffix = " studs/s",
    Callback = function(Value)
        Settings.SpeedValue = Value
        if Settings.SpeedEnabled then
            local char = LocalPlayer.Character
            if char then
                local hum = char:FindFirstChildOfClass("Humanoid")
                if hum then hum.WalkSpeed = Value end
            end
        end
    end
})

-- Settings Tab
local SettingsTab = Window:AddTab({Title = "Settings", Icon = "settings"})

SettingsTab:AddDropdown({
    Title = "Theme",
    Values = {"Dark", "Light", "Cyberpunk", "Ocean"},
    Default = "Dark",
    Callback = function(Value)
        Window:SetTheme(Value)
    end
})

-- Character respawn handler
LocalPlayer.CharacterAdded:Connect(function(char)
    task.wait(0.5)
    local hum = char:FindFirstChildOfClass("Humanoid")
    if hum then
        if Settings.SpeedEnabled then
            hum.WalkSpeed = Settings.SpeedValue
        end
    end
end)

-- Loaded notification
NexusUI:Notify({
    Title = "Loaded!",
    Content = "My Script Hub v1.0",
    Duration = 3
})

Want More?

Download our comprehensive examples file covering every feature including Media Support, Images, and Video integration:

Download EXAMPLE_USAGE.lua