-- Advanced Roblox Luau GUI Library for Executors
-- Made by Soldo / Discord: Soldo_io
-- Created with modern animations and comprehensive components
-- IMPORTANT: DO NOT call GuiLibrary:CreateTab(window, "Settings") in your example script!
-- The hidden Settings tab is created automatically.
local GuiLibrary = {}
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")
-- Animation settings
local ANIM_TIME = 0.3
local EASING_STYLE = Enum.EasingStyle.Quart
local EASING_DIRECTION = Enum.EasingDirection.Out
-- Initial Color scheme
local COLORS = {
PRIMARY = Color3.fromRGB(45, 45, 55),
SECONDARY = Color3.fromRGB(35, 35, 45),
ACCENT = Color3.fromRGB(100, 100, 255),
SUCCESS = Color3.fromRGB(75, 181, 67),
WARNING = Color3.fromRGB(255, 193, 7),
DANGER = Color3.fromRGB(220, 53, 69),
TEXT = Color3.fromRGB(220, 220, 220),
TEXT_MUTED = Color3.fromRGB(160, 160, 160),
BORDER = Color3.fromRGB(60, 60, 70),
HOVER = Color3.fromRGB(55, 55, 65)
}
-- Theme configurations
local themes = {
Dark = { PRIMARY = Color3.fromRGB(45, 45, 55), SECONDARY = Color3.fromRGB(35, 35, 45), ACCENT = Color3.fromRGB(100, 100, 255), SUCCESS = Color3.fromRGB(75, 181, 67), WARNING = Color3.fromRGB(255, 193, 7), DANGER = Color3.fromRGB(220, 53, 69), TEXT = Color3.fromRGB(220, 220, 220), TEXT_MUTED = Color3.fromRGB(160, 160, 160), BORDER = Color3.fromRGB(60, 60, 70), HOVER = Color3.fromRGB(55, 55, 65) },
Light = { PRIMARY = Color3.fromRGB(230, 230, 240), SECONDARY = Color3.fromRGB(245, 245, 250), ACCENT = Color3.fromRGB(50, 100, 200), SUCCESS = Color3.fromRGB(50, 150, 50), WARNING = Color3.fromRGB(200, 150, 0), DANGER = Color3.fromRGB(200, 50, 50), TEXT = Color3.fromRGB(40, 40, 50), TEXT_MUTED = Color3.fromRGB(100, 100, 120), BORDER = Color3.fromRGB(200, 200, 210), HOVER = Color3.fromRGB(220, 220, 230) },
Midnight = { PRIMARY = Color3.fromRGB(20, 20, 30), SECONDARY = Color3.fromRGB(15, 15, 25), ACCENT = Color3.fromRGB(80, 80, 150), SUCCESS = Color3.fromRGB(60, 150, 60), WARNING = Color3.fromRGB(200, 150, 0), DANGER = Color3.fromRGB(180, 40, 40), TEXT = Color3.fromRGB(200, 200, 210), TEXT_MUTED = Color3.fromRGB(140, 140, 160), BORDER = Color3.fromRGB(40, 40, 50), HOVER = Color3.fromRGB(30, 30, 40) },
Forest = { PRIMARY = Color3.fromRGB(30, 40, 30), SECONDARY = Color3.fromRGB(25, 35, 25), ACCENT = Color3.fromRGB(50, 120, 50), SUCCESS = Color3.fromRGB(60, 150, 60), WARNING = Color3.fromRGB(150, 120, 0), DANGER = Color3.fromRGB(150, 50, 50), TEXT = Color3.fromRGB(220, 230, 220), TEXT_MUTED = Color3.fromRGB(160, 180, 160), BORDER = Color3.fromRGB(40, 50, 40), HOVER = Color3.fromRGB(35, 45, 35) },
Ocean = { PRIMARY = Color3.fromRGB(30, 40, 50), SECONDARY = Color3.fromRGB(25, 35, 45), ACCENT = Color3.fromRGB(0, 100, 150), SUCCESS = Color3.fromRGB(50, 150, 100), WARNING = Color3.fromRGB(150, 120, 0), DANGER = Color3.fromRGB(150, 50, 50), TEXT = Color3.fromRGB(220, 230, 240), TEXT_MUTED = Color3.fromRGB(160, 180, 200), BORDER = Color3.fromRGB(40, 50, 60), HOVER = Color3.fromRGB(35, 45, 55) }
}
-- Auto Save System
local AUTO_SAVE_FOLDER = "GuiLibrary_AutoSaves"
local autoSaveEnabled = false
local currentPlaceId = tostring(game.PlaceId)
local function ensureAutoSaveFolder()
pcall(function() if not isfolder(AUTO_SAVE_FOLDER) then makefolder(AUTO_SAVE_FOLDER) end end)
end
local function getAutoSavePath()
return AUTO_SAVE_FOLDER .. "/" .. currentPlaceId .. ".json"
end
print("DEBUG: GuiLibrary loaded - Soldo_io")
local function createTween(object, properties, time)
time = time or ANIM_TIME
local tweenInfo = TweenInfo.new(time, EASING_STYLE, EASING_DIRECTION)
local tween = TweenService:Create(object, tweenInfo, properties)
tween:Play()
return tween
end
local function createCorner(parent, radius)
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, radius or 8)
corner.Parent = parent
return corner
end
local function createStroke(parent, thickness, color)
local stroke = Instance.new("UIStroke")
stroke.Thickness = thickness or 1
stroke.Color = color or COLORS.BORDER
stroke.Parent = parent
return stroke
end
local function updateElementColors(window)
print("DEBUG: updateElementColors called")
if window.MainFrame then
createTween(window.MainFrame, {BackgroundColor3 = COLORS.PRIMARY})
local uiStroke = window.MainFrame:FindFirstChild("UIStroke")
if uiStroke then createTween(uiStroke, {Color = COLORS.BORDER}) end
end
local titleBar = window.MainFrame and window.MainFrame:FindFirstChild("TitleBar")
if titleBar then
createTween(titleBar, {BackgroundColor3 = COLORS.SECONDARY})
local titleLabel = titleBar:FindFirstChild("TitleLabel")
if titleLabel then createTween(titleLabel, {TextColor3 = COLORS.TEXT}) end
local fpsLabel = titleBar:FindFirstChild("FPSLabel")
if fpsLabel then createTween(fpsLabel, {BackgroundColor3 = COLORS.PRIMARY}) end
local settingsButton = titleBar:FindFirstChild("SettingsButton")
if settingsButton then createTween(settingsButton, {TextColor3 = COLORS.TEXT}) end
local closeButton = titleBar:FindFirstChild("CloseButton")
if closeButton then createTween(closeButton, {TextColor3 = COLORS.DANGER}) end
end
for tabName, tab in pairs(window.Tabs or {}) do
if tab.Button then
if window.CurrentTab == tabName then
createTween(tab.Button, {BackgroundColor3 = COLORS.ACCENT, TextColor3 = COLORS.TEXT})
else
createTween(tab.Button, {BackgroundColor3 = COLORS.SECONDARY, TextColor3 = COLORS.TEXT_MUTED})
end
end
if tab.Content then createTween(tab.Content, {ScrollBarImageColor3 = COLORS.ACCENT}) end
for _, element in ipairs(tab.Elements or {}) do
if element and element:IsA("GuiObject") then
if element.Name:match("Button") and not element.Name:match("Tab") then
createTween(element, {BackgroundColor3 = COLORS.ACCENT, TextColor3 = COLORS.TEXT})
elseif element.Name:match("Toggle") then
createTween(element, {BackgroundColor3 = COLORS.SECONDARY})
local tb = element:FindFirstChild("TextButton")
if tb then
local ind = tb:FindFirstChild("Frame")
if ind then
local isOn = ind.Position.X.Scale > 0.5
createTween(tb, {BackgroundColor3 = isOn and COLORS.SUCCESS or COLORS.BORDER})
createTween(ind, {BackgroundColor3 = COLORS.TEXT})
end
end
local lbl = element:FindFirstChildWhichIsA("TextLabel")
if lbl then createTween(lbl, {TextColor3 = COLORS.TEXT}) end
elseif element.Name:match("Slider") then
createTween(element, {BackgroundColor3 = COLORS.SECONDARY})
local track = element:FindFirstChild("Frame")
if track then
createTween(track, {BackgroundColor3 = COLORS.BORDER})
local fill = track:FindFirstChild("Frame")
if fill then createTween(fill, {BackgroundColor3 = COLORS.ACCENT}) end
local handle = track:FindFirstChild("TextButton")
if handle then createTween(handle, {BackgroundColor3 = COLORS.TEXT}) end
end
local lbl = element:FindFirstChild("SliderLabel")
if lbl then createTween(lbl, {TextColor3 = COLORS.TEXT}) end
local val = element:FindFirstChild("TextLabel", true)
if val and val.Name ~= "SliderLabel" then createTween(val, {TextColor3 = COLORS.ACCENT}) end
elseif element.Name:match("Section") then
createTween(element, {BackgroundColor3 = COLORS.BORDER})
local lbl = element:FindFirstChildWhichIsA("TextLabel")
if lbl then createTween(lbl, {TextColor3 = COLORS.TEXT}) end
end
end
end
end
end
local function createLoader(parent, size)
local loaderFrame = Instance.new("Frame")
loaderFrame.Size = UDim2.new(0, size, 0, size)
loaderFrame.Position = UDim2.new(0.5, -size/2, 0.5, -size/2)
loaderFrame.BackgroundTransparency = 1
loaderFrame.Parent = parent
local dots = {}
local numDots = 8
local radius = size * 0.3
for i = 1, numDots do
local dot = Instance.new("Frame")
dot.Size = UDim2.new(0, 10, 0, 10)
dot.BackgroundColor3 = COLORS.ACCENT
dot.BorderSizePixel = 0
dot.Parent = loaderFrame
createCorner(dot, 5)
local angle = (i - 1) * (2 * math.pi / numDots)
dot.Position = UDim2.new(0.5, math.cos(angle) * radius, 0.5, math.sin(angle) * radius)
table.insert(dots, dot)
end
task.spawn(function()
while loaderFrame.Parent do
for _, dot in ipairs(dots) do
createTween(dot, {Size = UDim2.new(0, 14, 0, 14), BackgroundTransparency = 0}, 0.3)
task.wait(0.1)
createTween(dot, {Size = UDim2.new(0, 10, 0, 10), BackgroundTransparency = 0.5}, 0.3)
end
task.wait(0.2)
end
end)
return loaderFrame
end
local function saveConfig(window)
print("DEBUG: saveConfig called - autoSaveEnabled =", autoSaveEnabled)
window = window or GuiLibrary.CurrentWindow
if not window or not window.CurrentSize then
print("DEBUG: saveConfig skipped - no window or CurrentSize")
return
end
ensureAutoSaveFolder()
local config = {
UIScale = window.CurrentSize.X.Offset / 600,
AnimationsEnabled = (ANIM_TIME > 0.05),
Components = {}
}
for _, tab in pairs(window.Tabs or {}) do
for _, element in ipairs(tab.Elements or {}) do
local id = element:GetAttribute("ElementID")
if not id then continue end
local data = {Type = nil, Value = nil}
if element.Name:match("Toggle") then
local tb = element:FindFirstChild("TextButton")
local ind = tb and tb:FindFirstChild("Frame")
if ind then data.Type = "Toggle" data.Value = ind.Position.X.Scale > 0.5 end
elseif element.Name:match("Slider") then
local valLabel = element:FindFirstChild("TextLabel", true)
if valLabel and valLabel.Name ~= "SliderLabel" then data.Type = "Slider" data.Value = tonumber(valLabel.Text) or 0 end
end
if data.Type then table.insert(config.Components, {ID = id, Data = data}) end
end
end
pcall(function() writefile(getAutoSavePath(), HttpService:JSONEncode(config)) end)
print("DEBUG: Config saved successfully to", getAutoSavePath())
end
GuiLibrary.SaveConfig = saveConfig
local function loadConfig(window)
print("DEBUG: loadConfig called")
local path = getAutoSavePath()
if not pcall(isfile, path) or not isfile(path) then print("DEBUG: No save file found") return false end
local success, config = pcall(function() return HttpService:JSONDecode(readfile(path)) end)
if not success or not config then print("DEBUG: Failed to decode save file") return false end
if config.UIScale then
local newSize = UDim2.new(0, 600 * config.UIScale, 0, 400 * config.UIScale)
window.CurrentSize = newSize
createTween(window.MainFrame, {Size = newSize}, 0.25)
end
if config.AnimationsEnabled ~= nil then ANIM_TIME = config.AnimationsEnabled and 0.3 or 0.01 end
for _, entry in ipairs(config.Components or {}) do
for _, tab in pairs(window.Tabs or {}) do
for _, element in ipairs(tab.Elements or {}) do
if element:GetAttribute("ElementID") == entry.ID then
local d = entry.Data
if d.Type == "Toggle" and d.Value ~= nil then
local tb = element:FindFirstChild("TextButton")
local ind = tb and tb:FindFirstChild("Frame")
if ind then
local isOn = d.Value
tb.BackgroundColor3 = isOn and COLORS.SUCCESS or COLORS.BORDER
ind.Position = isOn and UDim2.new(1, -18, 0.5, -8) or UDim2.new(0, 2, 0.5, -8)
end
elseif d.Type == "Slider" and d.Value then
local valLabel = element:FindFirstChild("TextLabel", true)
if valLabel and valLabel.Name ~= "SliderLabel" then valLabel.Text = tostring(d.Value) end
end
break
end
end
end
end
updateElementColors(window)
print("DEBUG: Config loaded successfully")
return true
end
-- ==================== COMPONENT FUNCTIONS ====================
function GuiLibrary:CreateButton(tab, text, callback)
local button = Instance.new("TextButton")
button.Name = text .. "Button"
button.Size = UDim2.new(1, 0, 0, 35)
button.BackgroundColor3 = COLORS.ACCENT
button.Text = text
button.TextColor3 = COLORS.TEXT
button.TextSize = 12
button.Font = Enum.Font.Gotham
button.BorderSizePixel = 0
button.Parent = tab.Content
createCorner(button, 6)
button.MouseButton1Click:Connect(function()
createTween(button, {Size = UDim2.new(1, -4, 0, 31)})
task.wait(0.1)
createTween(button, {Size = UDim2.new(1, 0, 0, 35)})
if callback then callback() end
end)
button.MouseEnter:Connect(function() createTween(button, {BackgroundColor3 = Color3.fromRGB(math.min(COLORS.ACCENT.R*255+20,255),math.min(COLORS.ACCENT.G*255+20,255),math.min(COLORS.ACCENT.B*255+20,255))}) end)
button.MouseLeave:Connect(function() createTween(button, {BackgroundColor3 = COLORS.ACCENT}) end)
table.insert(tab.Elements, button)
return button
end
function GuiLibrary:CreateToggle(tab, text, default, callback)
local toggleFrame = Instance.new("Frame")
toggleFrame.Name = text .. "Toggle"
toggleFrame.Size = UDim2.new(1, 0, 0, 35)
toggleFrame.BackgroundColor3 = COLORS.SECONDARY
toggleFrame.BorderSizePixel = 0
toggleFrame.Parent = tab.Content
createCorner(toggleFrame, 6)
local toggleLabel = Instance.new("TextLabel")
toggleLabel.Size = UDim2.new(1, -50, 1, 0)
toggleLabel.Position = UDim2.new(0, 10, 0, 0)
toggleLabel.BackgroundTransparency = 1
toggleLabel.Text = text
toggleLabel.TextColor3 = COLORS.TEXT
toggleLabel.TextSize = 12
toggleLabel.Font = Enum.Font.Gotham
toggleLabel.TextXAlignment = Enum.TextXAlignment.Left
toggleLabel.Parent = toggleFrame
local toggleButton = Instance.new("TextButton")
toggleButton.Size = UDim2.new(0, 40, 0, 20)
toggleButton.Position = UDim2.new(1, -45, 0.5, -10)
toggleButton.BackgroundColor3 = default and COLORS.SUCCESS or COLORS.BORDER
toggleButton.Text = ""
toggleButton.BorderSizePixel = 0
toggleButton.Parent = toggleFrame
createCorner(toggleButton, 10)
local toggleIndicator = Instance.new("Frame")
toggleIndicator.Size = UDim2.new(0, 16, 0, 16)
toggleIndicator.Position = default and UDim2.new(1, -18, 0.5, -8) or UDim2.new(0, 2, 0.5, -8)
toggleIndicator.BackgroundColor3 = COLORS.TEXT
toggleIndicator.BorderSizePixel = 0
toggleIndicator.Parent = toggleButton
createCorner(toggleIndicator, 8)
local isToggled = default or false
local elementID = (tab.Name or "Tab") .. "_" .. text:gsub("%s+", "_") .. "_Toggle"
toggleFrame:SetAttribute("ElementID", elementID)
toggleButton.MouseButton1Click:Connect(function()
isToggled = not isToggled
if isToggled then
createTween(toggleButton, {BackgroundColor3 = COLORS.SUCCESS})
createTween(toggleIndicator, {Position = UDim2.new(1, -18, 0.5, -8)})
else
createTween(toggleButton, {BackgroundColor3 = COLORS.BORDER})
createTween(toggleIndicator, {Position = UDim2.new(0, 2, 0.5, -8)})
end
if callback then callback(isToggled) end
if GuiLibrary.SaveConfig then GuiLibrary.SaveConfig() end
end)
toggleFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then createTween(toggleFrame, {BackgroundColor3 = COLORS.HOVER}) end end)
toggleFrame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then createTween(toggleFrame, {BackgroundColor3 = COLORS.SECONDARY}) end end)
table.insert(tab.Elements, toggleFrame)
return {Frame = toggleFrame, GetValue = function() return isToggled end}
end
function GuiLibrary:CreateSlider(tab, text, min, max, default, callback)
local sliderFrame = Instance.new("Frame")
sliderFrame.Name = text .. "Slider"
sliderFrame.Size = UDim2.new(1, 0, 0, 50)
sliderFrame.BackgroundColor3 = COLORS.SECONDARY
sliderFrame.BorderSizePixel = 0
sliderFrame.Parent = tab.Content
createCorner(sliderFrame, 6)
local sliderLabel = Instance.new("TextLabel")
sliderLabel.Name = "SliderLabel"
sliderLabel.Size = UDim2.new(0.7, 0, 0, 20)
sliderLabel.Position = UDim2.new(0, 10, 0, 5)
sliderLabel.BackgroundTransparency = 1
sliderLabel.Text = text
sliderLabel.TextColor3 = COLORS.TEXT
sliderLabel.TextSize = 12
sliderLabel.Font = Enum.Font.Gotham
sliderLabel.TextXAlignment = Enum.TextXAlignment.Left
sliderLabel.Parent = sliderFrame
local valueLabel = Instance.new("TextLabel")
valueLabel.Size = UDim2.new(0.3, -10, 0, 20)
valueLabel.Position = UDim2.new(0.7, 0, 0, 5)
valueLabel.BackgroundTransparency = 1
valueLabel.Text = tostring(default or min)
valueLabel.TextColor3 = COLORS.ACCENT
valueLabel.TextSize = 12
valueLabel.Font = Enum.Font.GothamBold
valueLabel.TextXAlignment = Enum.TextXAlignment.Right
valueLabel.Parent = sliderFrame
local sliderTrack = Instance.new("Frame")
sliderTrack.Size = UDim2.new(1, -20, 0, 4)
sliderTrack.Position = UDim2.new(0, 10, 1, -15)
sliderTrack.BackgroundColor3 = COLORS.BORDER
sliderTrack.BorderSizePixel = 0
sliderTrack.Parent = sliderFrame
createCorner(sliderTrack, 2)
local sliderFill = Instance.new("Frame")
sliderFill.Size = UDim2.new(0, 0, 1, 0)
sliderFill.BackgroundColor3 = COLORS.ACCENT
sliderFill.BorderSizePixel = 0
sliderFill.Parent = sliderTrack
createCorner(sliderFill, 2)
local sliderHandle = Instance.new("TextButton")
sliderHandle.Size = UDim2.new(0, 16, 0, 16)
sliderHandle.Position = UDim2.new(0, -8, 0.5, -8)
sliderHandle.BackgroundColor3 = COLORS.TEXT
sliderHandle.Text = ""
sliderHandle.BorderSizePixel = 0
sliderHandle.Parent = sliderTrack
createCorner(sliderHandle, 8)
local currentValue = default or min
local dragging = false
local function updateSlider(value)
currentValue = math.clamp(value, min, max)
local percentage = (currentValue - min) / (max - min)
createTween(sliderFill, {Size = UDim2.new(percentage, 0, 1, 0)}, 0.1)
createTween(sliderHandle, {Position = UDim2.new(percentage, -8, 0.5, -8)}, 0.1)
valueLabel.Text = string.format("%.1f", currentValue)
if callback then callback(currentValue) end
if GuiLibrary.SaveConfig then GuiLibrary.SaveConfig() end
end
sliderHandle.MouseButton1Down:Connect(function() dragging = true end)
UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 and dragging then dragging = false end end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local mousePos = input.Position.X
local trackPos = sliderTrack.AbsolutePosition.X
local trackSize = sliderTrack.AbsoluteSize.X
local percentage = math.clamp((mousePos - trackPos) / trackSize, 0, 1)
updateSlider(min + (max - min) * percentage)
end
end)
sliderTrack.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
local mousePos = input.Position.X
local trackPos = sliderTrack.AbsolutePosition.X
local trackSize = sliderTrack.AbsoluteSize.X
local percentage = math.clamp((mousePos - trackPos) / trackSize, 0, 1)
updateSlider(min + (max - min) * percentage)
end
end)
sliderFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then createTween(sliderFrame, {BackgroundColor3 = COLORS.HOVER}) end end)
sliderFrame.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement then createTween(sliderFrame, {BackgroundColor3 = COLORS.SECONDARY}) end end)
local elementID = (tab.Name or "Tab") .. "_" .. text:gsub("%s+", "_") .. "_Slider"
sliderFrame:SetAttribute("ElementID", elementID)
updateSlider(currentValue)
table.insert(tab.Elements, sliderFrame)
return {Frame = sliderFrame, GetValue = function() return currentValue end, SetValue = updateSlider}
end
function GuiLibrary:CreateDropdown(tab, text, options, callback)
local dropdownFrame = Instance.new("Frame")
dropdownFrame.Name = text .. "Dropdown"
dropdownFrame.Size = UDim2.new(1, 0, 0, 35)
dropdownFrame.BackgroundColor3 = COLORS.SECONDARY
dropdownFrame.BorderSizePixel = 0
dropdownFrame.Parent = tab.Content
createCorner(dropdownFrame, 6)
local dropdownButton = Instance.new("TextButton")
dropdownButton.Size = UDim2.new(1, -20, 0, 25)
dropdownButton.Position = UDim2.new(0, 10, 0, 5)
dropdownButton.BackgroundColor3 = COLORS.PRIMARY
dropdownButton.Text = text .. ": " .. (options[1] or "None")
dropdownButton.TextColor3 = COLORS.TEXT
dropdownButton.TextSize = 12
dropdownButton.Font = Enum.Font.Gotham
dropdownButton.BorderSizePixel = 0
dropdownButton.TextXAlignment = Enum.TextXAlignment.Left
dropdownButton.ZIndex = 110
dropdownButton.Parent = dropdownFrame
createCorner(dropdownButton, 4)
local dropdownArrow = Instance.new("TextLabel")
dropdownArrow.Size = UDim2.new(0, 20, 0, 20)
dropdownArrow.Position = UDim2.new(1, -30, 0, 5)
dropdownArrow.BackgroundTransparency = 1
dropdownArrow.Text = "▼"
dropdownArrow.TextColor3 = COLORS.TEXT_MUTED
dropdownArrow.TextSize = 10
dropdownArrow.Font = Enum.Font.Gotham
dropdownArrow.ZIndex = 110
dropdownArrow.Parent = dropdownButton
local dropdownList = Instance.new("ScrollingFrame")
dropdownList.Name = "DropdownList"
dropdownList.Size = UDim2.new(1, -20, 0, 0)
dropdownList.Position = UDim2.new(0, 10, 0, 35)
dropdownList.BackgroundColor3 = COLORS.PRIMARY
dropdownList.BorderSizePixel = 0
dropdownList.Visible = false
dropdownList.ZIndex = 100
dropdownList.ScrollBarThickness = 6
dropdownList.ScrollBarImageColor3 = COLORS.ACCENT
dropdownList.Parent = dropdownFrame
createCorner(dropdownList, 4)
createStroke(dropdownList, 1, COLORS.BORDER)
local listLayout = Instance.new("UIListLayout")
listLayout.SortOrder = Enum.SortOrder.LayoutOrder
listLayout.Parent = dropdownList
local contentPadding = Instance.new("UIPadding")
contentPadding.PaddingTop = UDim.new(0, 5)
contentPadding.PaddingBottom = UDim.new(0, 5)
contentPadding.Parent = dropdownList
local currentSelection = options[1] or "None"
local isOpen = false
local originalPositions = {}
local baseY = dropdownFrame.Position.Y.Offset + dropdownFrame.Size.Y.Offset
for i, element in ipairs(tab.Content:GetChildren()) do
if element:IsA("GuiObject") and element ~= dropdownFrame and element.Position.Y.Offset >= baseY then
originalPositions[element] = element.Position
end
end
for i, option in ipairs(options) do
local optionButton = Instance.new("TextButton")
optionButton.Size = UDim2.new(1, -10, 0, 25)
optionButton.BackgroundColor3 = Color3.new(0, 0, 0)
optionButton.BackgroundTransparency = 1
optionButton.Text = option
optionButton.TextColor3 = COLORS.TEXT
optionButton.TextSize = 11
optionButton.Font = Enum.Font.Gotham
optionButton.BorderSizePixel = 0
optionButton.LayoutOrder = i
optionButton.ZIndex = 101
optionButton.Parent = dropdownList
optionButton.MouseButton1Click:Connect(function()
currentSelection = option
dropdownButton.Text = text .. ": " .. option
isOpen = false
createTween(dropdownArrow, {Rotation = 0})
createTween(dropdownList, {Size = UDim2.new(1, -20, 0, 0)})
for element, pos in pairs(originalPositions) do createTween(element, {Position = pos}) end
task.wait(ANIM_TIME)
dropdownList.Visible = false
dropdownFrame.Size = UDim2.new(1, 0, 0, 35)
if callback then callback(option) end
end)
optionButton.MouseEnter:Connect(function() createTween(optionButton, {BackgroundTransparency = 0.9, TextColor3 = COLORS.TEXT}) end)
optionButton.MouseLeave:Connect(function() createTween(optionButton, {BackgroundTransparency = 1, TextColor3 = COLORS.TEXT_MUTED}) end)
end
dropdownButton.MouseButton1Click:Connect(function()
isOpen = not isOpen
if isOpen then
local dropdownHeight = math.min(#options * 25, 125)
dropdownFrame.Size = UDim2.new(1, 0, 0, 35 + dropdownHeight)
dropdownList.Size = UDim2.new(1, -20, 0, 0)
dropdownList.CanvasSize = UDim2.new(0, 0, 0, #options * 25)
dropdownList.Visible = true
createTween(dropdownArrow, {Rotation = 180})
createTween(dropdownList, {Size = UDim2.new(1, -20, 0, dropdownHeight)})
local offset = dropdownHeight
for element, pos in pairs(originalPositions) do
local newY = pos.Y.Offset + offset
createTween(element, {Position = UDim2.new(pos.X.Scale, pos.X.Offset, pos.Y.Scale, newY)})
end
else
createTween(dropdownArrow, {Rotation = 0})
createTween(dropdownList, {Size = UDim2.new(1, -20, 0, 0)})
for element, pos in pairs(originalPositions) do createTween(element, {Position = pos}) end
task.wait(ANIM_TIME)
dropdownList.Visible = false
dropdownFrame.Size = UDim2.new(1, 0, 0, 35)
end
end)
dropdownButton.MouseEnter:Connect(function() createTween(dropdownButton, {BackgroundColor3 = COLORS.HOVER}) end)
dropdownButton.MouseLeave:Connect(function() createTween(dropdownButton, {BackgroundColor3 = COLORS.PRIMARY}) end)
table.insert(tab.Elements, dropdownFrame)
return {Frame = dropdownFrame, GetValue = function() return currentSelection end}
end
function GuiLibrary:CreateLabel(tab, text)
local label = Instance.new("TextLabel")
label.Name = text .. "Label"
label.Size = UDim2.new(1, 0, 0, 25)
label.BackgroundTransparency = 1
label.Text = text
label.TextColor3 = COLORS.TEXT
label.TextSize = 12
label.Font = Enum.Font.Gotham
label.TextXAlignment = Enum.TextXAlignment.Left
label.Parent = tab.Content
table.insert(tab.Elements, label)
return label
end
function GuiLibrary:CreateSection(tab, title)
print("DEBUG: CreateSection called with title:", title)
local sectionFrame = Instance.new("Frame")
sectionFrame.Name = title .. "Section"
sectionFrame.Size = UDim2.new(1, 0, 0, 30)
sectionFrame.BackgroundColor3 = COLORS.BORDER
sectionFrame.BorderSizePixel = 0
sectionFrame.Parent = tab.Content
createCorner(sectionFrame, 4)
local sectionLabel = Instance.new("TextLabel")
sectionLabel.Size = UDim2.new(1, -20, 1, 0)
sectionLabel.Position = UDim2.new(0, 10, 0, 0)
sectionLabel.BackgroundTransparency = 1
sectionLabel.Text = title
sectionLabel.TextColor3 = COLORS.TEXT
sectionLabel.TextSize = 13
sectionLabel.Font = Enum.Font.GothamBold
sectionLabel.TextXAlignment = Enum.TextXAlignment.Left
sectionLabel.Parent = sectionFrame
table.insert(tab.Elements, sectionFrame)
return sectionFrame
end
function GuiLibrary:CreateInput(tab, placeholder, callback)
local inputFrame = Instance.new("Frame")
inputFrame.Name = placeholder .. "Input"
inputFrame.Size = UDim2.new(1, 0, 0, 35)
inputFrame.BackgroundColor3 = COLORS.SECONDARY
inputFrame.BorderSizePixel = 0
inputFrame.Parent = tab.Content
createCorner(inputFrame, 6)
local textBox = Instance.new("TextBox")
textBox.Size = UDim2.new(1, -20, 1, -10)
textBox.Position = UDim2.new(0, 10, 0, 5)
textBox.BackgroundColor3 = COLORS.PRIMARY
textBox.PlaceholderText = placeholder
textBox.PlaceholderColor3 = COLORS.TEXT_MUTED
textBox.Text = ""
textBox.TextColor3 = COLORS.TEXT
textBox.TextSize = 12
textBox.Font = Enum.Font.Gotham
textBox.BorderSizePixel = 0
textBox.ClearTextOnFocus = false
textBox.Parent = inputFrame
createCorner(textBox, 4)
textBox.FocusLost:Connect(function(enterPressed)
if callback and enterPressed then callback(textBox.Text) end
end)
textBox.Focused:Connect(function() createStroke(textBox, 2, COLORS.ACCENT) end)
textBox.FocusLost:Connect(function()
local stroke = textBox:FindFirstChild("UIStroke")
if stroke then stroke:Destroy() end
end)
table.insert(tab.Elements, inputFrame)
return {Frame = inputFrame, TextBox = textBox, GetValue = function() return textBox.Text end}
end
function GuiLibrary:CreateColorPicker(tab, text, defaultColor, callback)
local colorFrame = Instance.new("Frame")
colorFrame.Name = text .. "ColorPicker"
colorFrame.Size = UDim2.new(1, 0, 0, 35)
colorFrame.BackgroundColor3 = COLORS.SECONDARY
colorFrame.BorderSizePixel = 0
colorFrame.Parent = tab.Content
createCorner(colorFrame, 6)
local colorLabel = Instance.new("TextLabel")
colorLabel.Size = UDim2.new(1, -50, 1, 0)
colorLabel.Position = UDim2.new(0, 10, 0, 0)
colorLabel.BackgroundTransparency = 1
colorLabel.Text = text
colorLabel.TextColor3 = COLORS.TEXT
colorLabel.TextSize = 12
colorLabel.Font = Enum.Font.Gotham
colorLabel.TextXAlignment = Enum.TextXAlignment.Left
colorLabel.Parent = colorFrame
local colorDisplay = Instance.new("TextButton")
colorDisplay.Size = UDim2.new(0, 30, 0, 25)
colorDisplay.Position = UDim2.new(1, -35, 0.5, -12.5)
colorDisplay.BackgroundColor3 = defaultColor or Color3.new(1, 1, 1)
colorDisplay.Text = ""
colorDisplay.BorderSizePixel = 0
colorDisplay.Parent = colorFrame
createCorner(colorDisplay, 6)
createStroke(colorDisplay, 2, COLORS.BORDER)
local currentColor = defaultColor or Color3.new(1, 1, 1)
colorDisplay.MouseButton1Click:Connect(function()
local colors = {Color3.new(1,0,0), Color3.new(0,1,0), Color3.new(0,0,1), Color3.new(1,1,0), Color3.new(1,0,1), Color3.new(0,1,1), Color3.new(1,1,1), Color3.new(0,0,0)}
local currentIndex = 1
for i, color in ipairs(colors) do if currentColor == color then currentIndex = i break end end
currentIndex = currentIndex % #colors + 1
currentColor = colors[currentIndex]
createTween(colorDisplay, {BackgroundColor3 = currentColor})
if callback then callback(currentColor) end
end)
colorDisplay.MouseEnter:Connect(function() createTween(colorDisplay, {Size = UDim2.new(0, 32, 0, 27)}) end)
colorDisplay.MouseLeave:Connect(function() createTween(colorDisplay, {Size = UDim2.new(0, 30, 0, 25)}) end)
table.insert(tab.Elements, colorFrame)
return {Frame = colorFrame, GetValue = function() return currentColor end, SetColor = function(color) currentColor = color; colorDisplay.BackgroundColor3 = color end}
end
function GuiLibrary:CreateKeybind(tab, text, defaultKey, callback)
local keybindFrame = Instance.new("Frame")
keybindFrame.Name = text .. "Keybind"
keybindFrame.Size = UDim2.new(1, 0, 0, 35)
keybindFrame.BackgroundColor3 = COLORS.SECONDARY
keybindFrame.BorderSizePixel = 0
keybindFrame.Parent = tab.Content
createCorner(keybindFrame, 6)
local keybindLabel = Instance.new("TextLabel")
keybindLabel.Size = UDim2.new(1, -80, 1, 0)
keybindLabel.Position = UDim2.new(0, 10, 0, 0)
keybindLabel.BackgroundTransparency = 1
keybindLabel.Text = text
keybindLabel.TextColor3 = COLORS.TEXT
keybindLabel.TextSize = 12
keybindLabel.Font = Enum.Font.Gotham
keybindLabel.TextXAlignment = Enum.TextXAlignment.Left
keybindLabel.Parent = keybindFrame
local keybindButton = Instance.new("TextButton")
keybindButton.Size = UDim2.new(0, 60, 0, 25)
keybindButton.Position = UDim2.new(1, -65, 0.5, -12.5)
keybindButton.BackgroundColor3 = COLORS.PRIMARY
keybindButton.Text = defaultKey and defaultKey.Name or "None"
keybindButton.TextColor3 = COLORS.TEXT
keybindButton.TextSize = 10
keybindButton.Font = Enum.Font.Gotham
keybindButton.BorderSizePixel = 0
keybindButton.Parent = keybindFrame
createCorner(keybindButton, 4)
local currentKey = defaultKey
local listening = false
keybindButton.MouseButton1Click:Connect(function()
if listening then return end
listening = true
keybindButton.Text = "..."
createTween(keybindButton, {BackgroundColor3 = COLORS.WARNING})
local connection
connection = UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
currentKey = input.KeyCode
keybindButton.Text = input.KeyCode.Name
listening = false
createTween(keybindButton, {BackgroundColor3 = COLORS.PRIMARY})
connection:Disconnect()
end
end)
end)
if currentKey then
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed or listening then return end
if input.KeyCode == currentKey and callback then callback() end
end)
end
table.insert(tab.Elements, keybindFrame)
return {Frame = keybindFrame, GetKey = function() return currentKey end}
end
function GuiLibrary:CreateNotification(title, message, duration, notifType)
duration = duration or 3
notifType = notifType or "info"
local colors = { info = COLORS.ACCENT, success = COLORS.SUCCESS, warning = COLORS.WARNING, error = COLORS.DANGER }
local notifGui = Instance.new("ScreenGui")
notifGui.Name = "NotificationGui"
notifGui.Parent = game.CoreGui
local notifFrame = Instance.new("Frame")
notifFrame.Size = UDim2.new(0, 300, 0, 80)
notifFrame.Position = UDim2.new(1, 0, 0, 50)
notifFrame.BackgroundColor3 = COLORS.PRIMARY
notifFrame.BorderSizePixel = 0
notifFrame.Parent = notifGui
createCorner(notifFrame, 8)
createStroke(notifFrame, 2, colors[notifType])
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -20, 0, 25)
titleLabel.Position = UDim2.new(0, 10, 0, 5)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = title
titleLabel.TextColor3 = colors[notifType]
titleLabel.TextSize = 14
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = notifFrame
local messageLabel = Instance.new("TextLabel")
messageLabel.Size = UDim2.new(1, -20, 0, 45)
messageLabel.Position = UDim2.new(0, 10, 0, 25)
messageLabel.BackgroundTransparency = 1
messageLabel.Text = message
messageLabel.TextColor3 = COLORS.TEXT
messageLabel.TextSize = 11
messageLabel.Font = Enum.Font.Gotham
messageLabel.TextXAlignment = Enum.TextXAlignment.Left
messageLabel.TextWrapped = true
messageLabel.Parent = notifFrame
createTween(notifFrame, {Position = UDim2.new(1, -310, 0, 50)})
task.wait(duration)
createTween(notifFrame, {Position = UDim2.new(1, 0, 0, 50)})
task.wait(ANIM_TIME)
notifGui:Destroy()
end
-- ==================== HIDDEN SETTINGS TAB ====================
function GuiLibrary:CreateSettingsTab(window)
print("DEBUG: CreateSettingsTab called - creating hidden settings tab")
local name = "Settings"
local tabContent = Instance.new("ScrollingFrame")
tabContent.Name = name .. "Content"
tabContent.Size = UDim2.new(1, 0, 1, 0)
tabContent.BackgroundTransparency = 1
tabContent.BorderSizePixel = 0
tabContent.ScrollBarThickness = 6
tabContent.ScrollBarImageColor3 = COLORS.ACCENT
tabContent.Visible = false
tabContent.Parent = window.TabContentContainer
local contentLayout = Instance.new("UIListLayout")
contentLayout.SortOrder = Enum.SortOrder.LayoutOrder
contentLayout.Padding = UDim.new(0, 8)
contentLayout.Parent = tabContent
local contentPadding = Instance.new("UIPadding")
contentPadding.PaddingTop = UDim.new(0, 10)
contentPadding.PaddingLeft = UDim.new(0, 10)
contentPadding.PaddingRight = UDim.new(0, 10)
contentPadding.PaddingBottom = UDim.new(0, 10)
contentPadding.Parent = tabContent
local settingsTab = { Button = nil, Content = tabContent, Name = name, Elements = {} }
window.Tabs[name] = settingsTab
print("DEBUG: Hidden Settings tab created and added to window.Tabs")
GuiLibrary:CreateSection(settingsTab, "UI Settings | Library by Soldo_io")
GuiLibrary:CreateKeybind(settingsTab, "Toggle GUI", Enum.KeyCode.Insert, function() window.Toggle() end)
GuiLibrary:CreateSlider(settingsTab, "UI Scale", 0.5, 2.0, 1.0, function(value)
local newSize = UDim2.new(0, 600 * value, 0, 400 * value)
window.CurrentSize = newSize
createTween(window.MainFrame, {Size = newSize}, 0.2)
GuiLibrary.SaveConfig()
end)
GuiLibrary:CreateDropdown(settingsTab, "Theme", {"Dark", "Light", "Midnight", "Forest", "Ocean"}, function(theme)
for key, color in pairs(themes[theme]) do COLORS[key] = color end
updateElementColors(window)
GuiLibrary.SaveConfig()
end)
GuiLibrary:CreateToggle(settingsTab, "Enable Animations", true, function(state)
ANIM_TIME = state and 0.3 or 0.01
GuiLibrary.SaveConfig()
end)
GuiLibrary:CreateToggle(settingsTab, "Auto Save Config", false, function(state)
autoSaveEnabled = state
if state then
GuiLibrary.SaveConfig()
GuiLibrary:CreateNotification("Auto Save", "Enabled - Settings will now save automatically", 3, "success")
else
GuiLibrary:CreateNotification("Auto Save", "Disabled", 2, "info")
end
end)
GuiLibrary:CreateSection(settingsTab, "Performance | Library by Soldo_io")
GuiLibrary:CreateToggle(settingsTab, "Show FPS", false, function(state)
if state and window.FPSLabel then window.FPSLabel.Visible = true elseif window.FPSLabel then window.FPSLabel.Visible = false end
end)
GuiLibrary:CreateButton(settingsTab, "Reset Settings", function()
GuiLibrary:CreateNotification("Settings", "Settings have been reset to default!", 2, "info")
for key, color in pairs(themes["Dark"]) do COLORS[key] = color end
window.MainFrame.Size = UDim2.new(0, 600, 0, 400)
window.CurrentSize = UDim2.new(0, 600, 0, 400)
ANIM_TIME = 0.3
updateElementColors(window)
GuiLibrary.SaveConfig()
end)
print("DEBUG: All settings elements created successfully")
end
-- ==================== CreateWindow ====================
function GuiLibrary:CreateWindow(title, size)
print("DEBUG: CreateWindow started")
title = title or "GUI Library"
size = size or UDim2.new(0, 600, 0, 400)
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "GuiLibraryUI"
screenGui.ResetOnSpawn = false
screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
screenGui.Parent = game.CoreGui
local loader = createLoader(screenGui, 100)
local mainFrame = Instance.new("Frame")
mainFrame.Name = "MainFrame"
mainFrame.Size = UDim2.new(0, 0, 0, 0)
mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
mainFrame.BackgroundColor3 = COLORS.PRIMARY
mainFrame.BorderSizePixel = 0
mainFrame.Active = true
mainFrame.Draggable = true
mainFrame.Visible = false
mainFrame.Parent = screenGui
createCorner(mainFrame, 12)
createStroke(mainFrame, 2, COLORS.BORDER)
local titleBar = Instance.new("Frame")
titleBar.Name = "TitleBar"
titleBar.Size = UDim2.new(1, 0, 0, 40)
titleBar.BackgroundColor3 = COLORS.SECONDARY
titleBar.BorderSizePixel = 0
titleBar.Parent = mainFrame
createCorner(titleBar, 12)
local titleLabel = Instance.new("TextLabel")
titleLabel.Name = "TitleLabel"
titleLabel.Size = UDim2.new(1, -140, 1, 0)
titleLabel.Position = UDim2.new(0, 10, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = title
titleLabel.TextColor3 = COLORS.TEXT
titleLabel.TextSize = 16
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = titleBar
local fpsLabel = Instance.new("TextLabel")
fpsLabel.Name = "FPSLabel"
fpsLabel.Size = UDim2.new(0, 60, 0, 30)
fpsLabel.Position = UDim2.new(1, -130, 0, 5)
fpsLabel.BackgroundColor3 = COLORS.PRIMARY
fpsLabel.TextColor3 = COLORS.SUCCESS
fpsLabel.TextSize = 12
fpsLabel.Font = Enum.Font.GothamBold
fpsLabel.Text = "FPS: 60"
fpsLabel.Visible = false
fpsLabel.Parent = titleBar
createCorner(fpsLabel, 4)
local settingsButton = Instance.new("TextButton")
settingsButton.Name = "SettingsButton"
settingsButton.Size = UDim2.new(0, 30, 0, 30)
settingsButton.Position = UDim2.new(1, -70, 0, 5)
settingsButton.BackgroundTransparency = 1
settingsButton.Text = "⚙️"
settingsButton.TextColor3 = COLORS.TEXT
settingsButton.TextSize = 14
settingsButton.Font = Enum.Font.GothamBold
settingsButton.BorderSizePixel = 0
settingsButton.Parent = titleBar
createCorner(settingsButton, 6)
local closeButton = Instance.new("TextButton")
closeButton.Name = "CloseButton"
closeButton.Size = UDim2.new(0, 30, 0, 30)
closeButton.Position = UDim2.new(1, -35, 0, 5)
closeButton.BackgroundTransparency = 1
closeButton.Text = "❌"
closeButton.TextColor3 = COLORS.DANGER
closeButton.TextSize = 14
closeButton.Font = Enum.Font.GothamBold
closeButton.BorderSizePixel = 0
closeButton.Parent = titleBar
createCorner(closeButton, 6)
local contentFrame = Instance.new("Frame")
contentFrame.Name = "ContentFrame"
contentFrame.Size = UDim2.new(1, -20, 1, -60)
contentFrame.Position = UDim2.new(0, 10, 0, 50)
contentFrame.BackgroundTransparency = 1
contentFrame.Parent = mainFrame
local tabsContainer = Instance.new("Frame")
tabsContainer.Name = "TabsContainer"
tabsContainer.Size = UDim2.new(1, 0, 0, 35)
tabsContainer.BackgroundTransparency = 1
tabsContainer.Parent = contentFrame
local tabsLayout = Instance.new("UIListLayout")
tabsLayout.FillDirection = Enum.FillDirection.Horizontal
tabsLayout.SortOrder = Enum.SortOrder.LayoutOrder
tabsLayout.Padding = UDim.new(0, 5)
tabsLayout.Parent = tabsContainer
local tabContentContainer = Instance.new("Frame")
tabContentContainer.Name = "TabContentContainer"
tabContentContainer.Size = UDim2.new(1, 0, 1, -45)
tabContentContainer.Position = UDim2.new(0, 0, 0, 45)
tabContentContainer.BackgroundTransparency = 1
tabContentContainer.Parent = contentFrame
local window = {
ScreenGui = screenGui,
MainFrame = mainFrame,
ContentFrame = contentFrame,
TabsContainer = tabsContainer,
TabContentContainer = tabContentContainer,
Tabs = {},
CurrentTab = nil,
CurrentSize = size,
FPSLabel = fpsLabel
}
GuiLibrary.CurrentWindow = window -- <--- THIS FIXES THE NIL ERROR
local isVisible = true
local function hideWindow()
if not isVisible then return end
isVisible = false
window.CurrentSize = mainFrame.Size
createTween(mainFrame, {Size = UDim2.new(0, window.CurrentSize.X.Offset * 0.8, 0, window.CurrentSize.Y.Offset * 0.8), BackgroundTransparency = 0.7}, ANIM_TIME * 0.5)
task.wait(ANIM_TIME * 0.5)
createTween(mainFrame, {Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundTransparency = 1, Rotation = 45}, ANIM_TIME * 0.5)
task.wait(ANIM_TIME * 0.5)
mainFrame.Visible = false
end
local function showWindow()
if isVisible then return end
isVisible = true
mainFrame.Visible = true
mainFrame.Size = UDim2.new(0, 0, 0, 0)
mainFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
mainFrame.BackgroundTransparency = 1
mainFrame.Rotation = -45
createTween(mainFrame, {Size = UDim2.new(0, window.CurrentSize.X.Offset * 0.8, 0, window.CurrentSize.Y.Offset * 0.8), BackgroundTransparency = 0.3, Rotation = 0}, ANIM_TIME * 0.5)
task.wait(ANIM_TIME * 0.5)
createTween(mainFrame, {Size = window.CurrentSize, Position = UDim2.new(0.5, -window.CurrentSize.X.Offset/2, 0.5, -window.CurrentSize.Y.Offset/2), BackgroundTransparency = 0}, ANIM_TIME * 0.5)
end
settingsButton.MouseButton1Click:Connect(function()
print("DEBUG: Gear button clicked - opening hidden Settings tab")
local settingsTab = window.Tabs["Settings"]
if not settingsTab then print("DEBUG: Settings tab not found!") return end
if window.CurrentTab and window.Tabs[window.CurrentTab] then
local current = window.Tabs[window.CurrentTab]
if current.Button then createTween(current.Button, {BackgroundColor3 = COLORS.SECONDARY, TextColor3 = COLORS.TEXT_MUTED}) end
current.Content.Visible = false
end
window.CurrentTab = "Settings"
settingsTab.Content.Visible = true
print("DEBUG: Hidden Settings tab is now visible")
end)
settingsButton.MouseEnter:Connect(function() createTween(settingsButton, {TextColor3 = COLORS.HOVER}) end)
settingsButton.MouseLeave:Connect(function() createTween(settingsButton, {TextColor3 = COLORS.TEXT}) end)
closeButton.MouseButton1Click:Connect(function()
createTween(mainFrame, {Size = UDim2.new(0, 0, 0, 0), Position = UDim2.new(0.5, 0, 0.5, 0)})
task.wait(ANIM_TIME)
screenGui:Destroy()
end)
closeButton.MouseEnter:Connect(function() createTween(closeButton, {TextColor3 = Color3.fromRGB(255, 75, 75)}) end)
closeButton.MouseLeave:Connect(function() createTween(closeButton, {TextColor3 = COLORS.DANGER}) end)
task.wait(1.5)
loader:Destroy()
mainFrame.Visible = true
createTween(mainFrame, {Size = size, Position = UDim2.new(0.5, -size.X.Offset/2, 0.5, -size.Y.Offset/2)})
print("DEBUG: Creating hidden Settings tab now...")
GuiLibrary:CreateSettingsTab(window)
task.spawn(function()
task.wait(0.5)
loadConfig(window)
end)
window.Hide = hideWindow
window.Show = showWindow
window.Toggle = function() if isVisible then hideWindow() else showWindow() end end
updateElementColors(window)
print("DEBUG: CreateWindow finished - GUI ready")
return window
end
-- Tab System (normal visible tabs)
function GuiLibrary:CreateTab(window, name)
local tabButton = Instance.new("TextButton")
tabButton.Name = name .. "Tab"
tabButton.Size = UDim2.new(0, 100, 1, 0)
tabButton.BackgroundColor3 = COLORS.SECONDARY
tabButton.Text = name
tabButton.TextColor3 = COLORS.TEXT_MUTED
tabButton.TextSize = 12
tabButton.Font = Enum.Font.Gotham
tabButton.BorderSizePixel = 0
tabButton.Parent = window.TabsContainer
createCorner(tabButton, 6)
local tabContent = Instance.new("ScrollingFrame")
tabContent.Name = name .. "Content"
tabContent.Size = UDim2.new(1, 0, 1, 0)
tabContent.BackgroundTransparency = 1
tabContent.BorderSizePixel = 0
tabContent.ScrollBarThickness = 6
tabContent.ScrollBarImageColor3 = COLORS.ACCENT
tabContent.Visible = false
tabContent.Parent = window.TabContentContainer
local contentLayout = Instance.new("UIListLayout")
contentLayout.SortOrder = Enum.SortOrder.LayoutOrder
contentLayout.Padding = UDim.new(0, 8)
contentLayout.Parent = tabContent
local contentPadding = Instance.new("UIPadding")
contentPadding.PaddingTop = UDim.new(0, 10)
contentPadding.PaddingLeft = UDim.new(0, 10)
contentPadding.PaddingRight = UDim.new(0, 10)
contentPadding.PaddingBottom = UDim.new(0, 10)
contentPadding.Parent = tabContent
local function updateCanvasSize()
local totalHeight = contentPadding.PaddingTop.Offset + contentPadding.PaddingBottom.Offset
for _, child in ipairs(tabContent:GetChildren()) do
if child:IsA("GuiObject") and child ~= contentLayout and child ~= contentPadding then
totalHeight = totalHeight + child.Size.Y.Offset + contentLayout.Padding.Offset
end
end
tabContent.CanvasSize = UDim2.new(0, 0, 0, totalHeight)
end
contentLayout.Changed:Connect(updateCanvasSize)
tabContent.ChildAdded:Connect(updateCanvasSize)
tabContent.ChildRemoved:Connect(updateCanvasSize)
updateCanvasSize()
local tab = { Button = tabButton, Content = tabContent, Name = name, Elements = {} }
window.Tabs[name] = tab
local function switchTab()
print("DEBUG: switchTab called - switching to", name)
if window.CurrentTab == name then return end
if window.CurrentTab and window.Tabs[window.CurrentTab] then
local current = window.Tabs[window.CurrentTab]
if current.Button then
createTween(current.Button, {BackgroundColor3 = COLORS.SECONDARY, TextColor3 = COLORS.TEXT_MUTED})
end
current.Content.Visible = false
end
window.CurrentTab = name
createTween(tabButton, {BackgroundColor3 = COLORS.ACCENT, TextColor3 = COLORS.TEXT})
tabContent.Visible = true
print("DEBUG: Switched to tab", name)
end
tabButton.MouseButton1Click:Connect(switchTab)
tabButton.MouseEnter:Connect(function() if window.CurrentTab ~= name then createTween(tabButton, {BackgroundColor3 = COLORS.HOVER}) end end)
tabButton.MouseLeave:Connect(function() if window.CurrentTab ~= name then createTween(tabButton, {BackgroundColor3 = COLORS.SECONDARY}) end end)
if not window.CurrentTab then
window.CurrentTab = name
createTween(tabButton, {BackgroundColor3 = COLORS.ACCENT, TextColor3 = COLORS.TEXT})
tabContent.Visible = true
end
updateElementColors(window)
return tab
end
return GuiLibrary