This page provides Lua code snippets for each EngoUILib UI element, ready to use in your Roblox UI. Copy the code to create buttons, toggles, sliders, and more. Ensure you load the library with:
local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/joeengo/roblox/main/EngoUILib.lua"))()
Initialize the UI and create a tab to hold elements.
-- Create main UI
local ui = library:CreateMain("My Custom UI", "A custom UI for my game", Enum.KeyCode.RightShift)
-- Set theme (optional)
library:SetTheme("Crimson") -- Options: Engo, Swamp, Sky, Crimson, Gray, Discord
-- Create a tab
local tab = ui:CreateTab("Main")
API: library:CreateMain(title, description, keycode)
creates a draggable window. library:SetTheme(theme)
sets the theme. ui:CreateTab(name)
creates a tab.
A clickable button that triggers a callback.
tab:CreateButton("Click Me", function()
print("Button clicked!")
end)
API: tab:CreateButton(text, callback)
Callback: Called when the button is clicked.
Example: Start a game action.
tab:CreateButton("Start Game", function()
print("Game started!")
-- Game start logic
end)
A switch that toggles on/off, triggering a callback with its state.
local toggle = tab:CreateToggle("Enable Feature", function(state)
print("Toggle state:", state)
end)
-- Programmatically toggle
toggle:Toggle(true)
API: tab:CreateToggle(text, callback)
returns a toggle object.
Methods/Properties: toggle:Toggle(bool)
, toggle.Enabled
(boolean).
Callback: Receives true
(on) or false
(off).
Example: Toggle god mode.
local godMode = tab:CreateToggle("God Mode", function(state)
print("God Mode:", state and "Enabled" or "Disabled")
end)
A text input field that triggers a callback when text is submitted.
local textbox = tab:CreateTextbox("Enter Name", function(text)
print("Entered text:", text)
end)
-- Access current text
print(textbox.Text)
API: tab:CreateTextbox(text, callback)
returns a textbox object.
Properties: textbox.Text
(string).
Callback: Called with the entered text on focus loss.
Example: Set player name.
local playerName = tab:CreateTextbox("Player Name", function(text)
print("Player Name:", text)
end)
A slider for selecting a value in a range, triggering a callback.
local slider = tab:CreateSlider("Volume", 0, 100, function(value)
print("Slider value:", value)
end)
-- Set value
slider:SetValue(50)
API: tab:CreateSlider(text, min, max, callback)
returns a slider object.
Methods/Properties: slider:SetValue(value)
, slider.Value
(number).
Callback: Called with the selected value.
Example: Adjust player speed.
local speedSlider = tab:CreateSlider("Speed", 10, 50, function(value)
print("Speed:", value)
end)
speedSlider:SetValue(25)
A non-interactive text display.
local label = tab:CreateLabel("Status: Idle")
-- Update text
label:Update("Status: Active")
API: tab:CreateLabel(text)
returns a label object.
Methods: label:Update(newText)
Example: Display score.
local scoreLabel = tab:CreateLabel("Score: 0")
game:GetService("RunService").Heartbeat:Connect(function()
scoreLabel:Update("Score: " .. tostring(math.random(100)))
end)
A keybind that triggers a callback when the assigned key is pressed.
local bind = tab:CreateBind("Action Key", Enum.KeyCode.E, function(key)
print("Key pressed:", key.Name)
end)
-- Access current key
print(bind.Bind.Name)
API: tab:CreateBind(text, defaultKey, callback)
returns a bind object.
Properties: bind.Bind
(keycode), bind.IsBinding
(boolean).
Callback: Called with the pressed keycode.
Example: Jump action.
local jumpBind = tab:CreateBind("Jump", Enum.KeyCode.Space, function(key)
print("Jump triggered by:", key.Name)
end)
A dropdown menu for selecting an option, triggering a callback.
local dropdown = tab:CreateDropdown("Select Item", {"Item1", "Item2", "Item3"}, function(value)
print("Selected:", value)
end)
-- Add option
dropdown:CreateOption("Item4")
-- Refresh options
dropdown:RefreshOptions({"NewItem1", "NewItem2"})
API: tab:CreateDropdown(text, list, callback)
returns a dropdown object.
Methods/Properties: dropdown:CreateOption(text)
, dropdown:CreateOptions(list)
, dropdown:RefreshOptions(list)
, dropdown.Options
, dropdown.Value
, dropdown.Expanded
.
Callback: Called with the selected option.
Example: Select weapon.
local weaponDropdown = tab:CreateDropdown("Weapon", {"Sword", "Bow", "Staff"}, function(value)
print("Selected weapon:", value)
end)
weaponDropdown:CreateOption("Axe")
A list of textboxes for adding/removing entries, triggering a callback.
local textlist = tab:CreateTextList("Notes", function(values)
print("List values:", table.concat(values, ", "))
end)
-- Add text option
textlist:CreateTextOption()
-- Expand/collapse
textlist:Expand(true)
API: tab:CreateTextList(text, callback)
returns a textlist object.
Methods/Properties: textlist:CreateTextOption()
, textlist:Expand(bool)
, textlist.List
, textlist.ListValues
, textlist.Expanded
.
Callback: Called with a table of values.
Example: Task list.
local todoList = tab:CreateTextList("To-Do", function(values)
for i, v in pairs(values) do
print("Task", i, ":", v)
end
end)
todoList:CreateTextOption()
A slider for selecting a color hue, with a rainbow mode option.
local colorslider = tab:CreateColorSlider("Pick Color", function(value)
print("Selected hue:", value)
end)
-- Set hue
colorslider:SetValue(0.5)
-- Enable rainbow mode
colorslider:SetRainbow(true)
API: tab:CreateColorSlider(text, callback)
returns a colorslider object.
Methods/Properties: colorslider:SetValue(val)
, colorslider:SetRainbow(bool)
, colorslider.Value
, colorslider.RainbowValue
.
Callback: Called with the hue (0 to 1).
Example: Set light color.
local lightColor = tab:CreateColorSlider("Light Color", function(hue)
print("Light Hue:", hue)
end)
lightColor:SetRainbow(true)
A pop-up with OK/Cancel buttons for user confirmation.
ui:CreateNotification("Alert", "Do you want to proceed?", function(confirmed)
print("Notification confirmed:", confirmed)
end)
API: ui:CreateNotification(title, description, callback)
Callback: Called with true
(OK) or false
(Cancel).
Example: Confirm game restart.
ui:CreateNotification("Game Over", "Restart?", function(confirmed)
print("Restart:", confirmed and "Yes" or "No")
end)
A predefined tab with a keybind to hide the UI and a button to remove it.
local settings = ui:CreateSettings()
API: ui:CreateSettings()
creates a tab with a "HideGUI" bind and "RemoveGUI" button.
Note: The hide key defaults to RightControl
. The remove button destroys the UI.
A full UI with all elements.
local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/joeengo/roblox/main/EngoUILib.lua"))()
-- Set theme
library:SetTheme("Sky")
-- Create main UI
local ui = library:CreateMain("Game Control Panel", "Control your game settings", Enum.KeyCode.RightShift)
-- Main tab
local mainTab = ui:CreateTab("Main")
-- Button
mainTab:CreateButton("Start Game", function()
print("Game started!")
end)
-- Toggle
local godMode = mainTab:CreateToggle("God Mode", function(state)
print("God Mode:", state)
end)
-- Textbox
local playerName = mainTab:CreateTextbox("Player Name", function(text)
print("Player Name:", text)
end)
-- Slider
local speedSlider = mainTab:CreateSlider("Speed", 10, 50, function(value)
print("Speed:", value)
end)
-- Label
local statusLabel = mainTab:CreateLabel("Status: Ready")
game:GetService("RunService").Heartbeat:Connect(function()
statusLabel:Update("Status: Running (" .. os.clock() .. ")")
end)
-- Bind
mainTab:CreateBind("Jump", Enum.KeyCode.Space, function(key)
print("Jump triggered by:", key.Name)
end)
-- Dropdown
local weaponDropdown = mainTab:CreateDropdown("Weapon", {"Sword", "Bow", "Staff"}, function(value)
print("Selected weapon:", value)
end)
-- TextList
local tasks = mainTab:CreateTextList("Tasks", function(values)
print("Tasks:", table.concat(values, ", "))
end)
tasks:CreateTextOption()
-- ColorSlider
local lightColor = mainTab:CreateColorSlider("Light Color", function(hue)
print("Light Hue:", hue)
end)
-- Notification
ui:CreateNotification("Welcome", "Game UI loaded!", function(confirmed)
print("Welcome confirmed:", confirmed)
end)
-- Settings tab
local settings = ui:CreateSettings()