-- Lunar X GUI -- Put this LocalScript in StarterPlayer > StarterPlayerScripts (or run inside your executor) local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local LogService = game:GetService("LogService") local Lighting = game:GetService("Lighting") local player = Players.LocalPlayer local ACCENT = Color3.fromRGB(170, 70, 255) local BLACK = Color3.fromRGB(0, 0, 0) local DARK = Color3.fromRGB(22, 22, 26) local PANEL = Color3.fromRGB(14, 14, 18) local MUTED = Color3.fromRGB(180, 180, 190) local function tween(obj, t, props, style, dir) local tw = TweenService:Create(obj, TweenInfo.new(t, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props) tw:Play() return tw end local function corner(obj, r) local c = obj:FindFirstChildOfClass("UICorner") or Instance.new("UICorner") c.CornerRadius = r or UDim.new(0, 12) c.Parent = obj return c end local gui = Instance.new("ScreenGui") gui.Name = "LunarX" gui.ResetOnSpawn = false gui.IgnoreGuiInset = true gui.DisplayOrder = 999 gui.Parent = player:WaitForChild("PlayerGui") ---------------------------------------------------------------- MAIN WINDOW local main = Instance.new("Frame") main.Name = "Main" main.AnchorPoint = Vector2.new(0.5, 0.5) main.Position = UDim2.fromScale(0.5, 0.5) main.Size = UDim2.fromOffset(0, 0) main.BackgroundColor3 = BLACK main.BorderSizePixel = 0 main.ClipsDescendants = true main.Visible = false main.Parent = gui corner(main, UDim.new(0, 18)) local stroke = Instance.new("UIStroke") stroke.Color = ACCENT stroke.Thickness = 1.5 stroke.Transparency = 0.4 stroke.Parent = main local FULL = UDim2.fromOffset(630, 390) local titleBar = Instance.new("Frame") titleBar.Size = UDim2.new(1, 0, 0, 44) titleBar.BackgroundTransparency = 1 titleBar.Parent = main local title = Instance.new("TextLabel") title.Size = UDim2.new(0, 220, 1, 0) title.Position = UDim2.fromOffset(16, 0) title.BackgroundTransparency = 1 title.Text = "Lunar X 🌙" title.Font = Enum.Font.GothamBold title.TextSize = 22 title.TextColor3 = ACCENT title.TextXAlignment = Enum.TextXAlignment.Left title.Parent = titleBar local closeBtn = Instance.new("TextButton") closeBtn.Size = UDim2.fromOffset(30, 30) closeBtn.AnchorPoint = Vector2.new(1, 0.5) closeBtn.Position = UDim2.new(1, -12, 0.5, 0) closeBtn.BackgroundColor3 = DARK closeBtn.Text = "X" closeBtn.Font = Enum.Font.GothamBold closeBtn.TextSize = 16 closeBtn.TextColor3 = Color3.new(1, 1, 1) closeBtn.Parent = titleBar corner(closeBtn, UDim.new(0, 8)) -- Vertical sidebar on the left local SIDEBAR_WIDTH = 118 local tabBar = Instance.new("Frame") tabBar.Position = UDim2.fromOffset(12, 50) tabBar.Size = UDim2.new(0, SIDEBAR_WIDTH, 1, -62) tabBar.BackgroundColor3 = PANEL tabBar.BorderSizePixel = 0 tabBar.Parent = main corner(tabBar, UDim.new(0, 12)) local tabPad = Instance.new("UIPadding") tabPad.PaddingTop = UDim.new(0, 8) tabPad.PaddingBottom = UDim.new(0, 8) tabPad.PaddingLeft = UDim.new(0, 8) tabPad.PaddingRight = UDim.new(0, 8) tabPad.Parent = tabBar local tabLayout = Instance.new("UIListLayout") tabLayout.FillDirection = Enum.FillDirection.Vertical tabLayout.Padding = UDim.new(0, 6) tabLayout.Parent = tabBar local content = Instance.new("Frame") content.Position = UDim2.fromOffset(12 + SIDEBAR_WIDTH + 10, 50) content.Size = UDim2.new(1, -(22 + SIDEBAR_WIDTH + 12), 1, -62) content.BackgroundColor3 = DARK content.BorderSizePixel = 0 content.Parent = main corner(content, UDim.new(0, 12)) local tabNames = { "Editor", "Tools", "Hub", "ESP", "SB", "Developers", "Settings" } local pages, tabButtons = {}, {} local activeTabName = "Editor" local accentTargets = {} local function registerAccent(obj: Instance, propName: string) table.insert(accentTargets, { obj = obj, prop = propName }) end local function refreshTabHighlights() for n, b in pairs(tabButtons) do tween(b, 0.15, { BackgroundColor3 = (n == activeTabName) and ACCENT or BLACK, TextColor3 = (n == activeTabName) and Color3.new(1, 1, 1) or MUTED, }) end end local function selectTab(name) activeTabName = name for n, page in pairs(pages) do page.Visible = (n == name) end refreshTabHighlights() end for _, name in ipairs(tabNames) do local b = Instance.new("TextButton") b.Size = UDim2.new(1, 0, 0, 34) b.BackgroundColor3 = BLACK b.Text = (name == "SB") and "SB (Bot)" or name b.Font = Enum.Font.GothamBold b.TextSize = 13 b.TextColor3 = MUTED b.AutoButtonColor = false b.Parent = tabBar corner(b, UDim.new(0, 8)) tabButtons[name] = b local page = Instance.new("Frame") page.Size = UDim2.fromScale(1, 1) page.BackgroundTransparency = 1 page.Visible = false page.Parent = content pages[name] = page b.MouseButton1Click:Connect(function() selectTab(name) end) end registerAccent(stroke, "Color") registerAccent(title, "TextColor3") ---------------------------------------------------------------- SHARED EXECUTION HELPER local function getEnvLoadstring() local direct = (type(loadstring) == "function") and loadstring or nil if direct then return direct end if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" and type(env.loadstring) == "function" then return env.loadstring end end if type(_G) == "table" and type(rawget(_G, "loadstring")) == "function" then return rawget(_G, "loadstring") end if type(shared) == "table" and type(rawget(shared, "loadstring")) == "function" then return rawget(shared, "loadstring") end return nil end local function executeCode(source: string): (boolean, string) if not source or source:match("^%s*$") then return false, "Nothing to execute." end local envLoad = getEnvLoadstring() if envLoad then local fn, compileErr = envLoad(source) if not fn then return false, tostring(compileErr) end local ok, runErr = pcall(fn) if not ok then return false, tostring(runErr) end return true, "Executed Lua / loadstring successfully." end local ranAny = false for line in source:gmatch("[^\r\n]+") do local trimmed = line:match("^%s*(.-)%s*$") if trimmed ~= "" and not trimmed:match("^%-%-") then local printMsg = trimmed:match("^print%s*%(%s*[\"'](.-)[\"']%s*%)%s*;?$") local warnMsg = trimmed:match("^warn%s*%(%s*[\"'](.-)[\"']%s*%)%s*;?$") local speedVal = trimmed:match("WalkSpeed%s*=%s*(%d+)") local jumpVal = trimmed:match("JumpPower%s*=%s*(%d+)") if printMsg then print("[Lunar X] " .. printMsg) ranAny = true elseif warnMsg then warn("[Lunar X] " .. warnMsg) ranAny = true elseif speedVal then local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = tonumber(speedVal) or 16 ranAny = true end elseif jumpVal then local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid") if hum then hum.UseJumpPower = true hum.JumpPower = tonumber(jumpVal) or 50 ranAny = true end elseif trimmed == "respawn()" then local char = player.Character local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then hum.Health = 0 ranAny = true end end end end if ranAny then return true, "Ran supported client statements (Studio LocalScript mode)." end return false, "loadstring not exposed here. Try print(\"hi\"), warn(\"yo\"), WalkSpeed = 50, or respawn()." end ---------------------------------------------------------------- CONSOLE OVERLAY WINDOW local consoleWin = Instance.new("Frame") consoleWin.Name = "ConsoleWindow" consoleWin.Size = UDim2.fromOffset(480, 260) consoleWin.Position = UDim2.new(0.5, -240, 0.5, -130) consoleWin.BackgroundColor3 = BLACK consoleWin.BorderSizePixel = 0 consoleWin.Visible = false consoleWin.ZIndex = 20 consoleWin.Parent = gui corner(consoleWin, UDim.new(0, 14)) local consoleStroke = Instance.new("UIStroke") consoleStroke.Color = ACCENT consoleStroke.Thickness = 1.5 consoleStroke.Parent = consoleWin registerAccent(consoleStroke, "Color") local consoleTitle = Instance.new("TextLabel") consoleTitle.Size = UDim2.new(1, -90, 0, 34) consoleTitle.Position = UDim2.fromOffset(12, 0) consoleTitle.BackgroundTransparency = 1 consoleTitle.Text = "🖥️ Lunar X Console" consoleTitle.Font = Enum.Font.GothamBold consoleTitle.TextSize = 14 consoleTitle.TextColor3 = ACCENT consoleTitle.TextXAlignment = Enum.TextXAlignment.Left consoleTitle.ZIndex = 21 consoleTitle.Parent = consoleWin registerAccent(consoleTitle, "TextColor3") local consoleClose = Instance.new("TextButton") consoleClose.Size = UDim2.fromOffset(64, 24) consoleClose.Position = UDim2.new(1, -74, 0, 5) consoleClose.BackgroundColor3 = DARK consoleClose.Text = "Close" consoleClose.Font = Enum.Font.GothamBold consoleClose.TextSize = 11 consoleClose.TextColor3 = Color3.new(1, 1, 1) consoleClose.ZIndex = 21 consoleClose.Parent = consoleWin corner(consoleClose, UDim.new(0, 6)) local consoleScroll = Instance.new("ScrollingFrame") consoleScroll.Size = UDim2.new(1, -20, 1, -44) consoleScroll.Position = UDim2.fromOffset(10, 36) consoleScroll.BackgroundColor3 = PANEL consoleScroll.BorderSizePixel = 0 consoleScroll.ScrollBarThickness = 5 consoleScroll.CanvasSize = UDim2.fromOffset(0, 0) consoleScroll.ZIndex = 21 consoleScroll.Parent = consoleWin corner(consoleScroll, UDim.new(0, 8)) local consoleLayout = Instance.new("UIListLayout") consoleLayout.Padding = UDim.new(0, 3) consoleLayout.Parent = consoleScroll local consolePad = Instance.new("UIPadding") consolePad.PaddingTop = UDim.new(0, 6) consolePad.PaddingBottom = UDim.new(0, 6) consolePad.PaddingLeft = UDim.new(0, 8) consolePad.PaddingRight = UDim.new(0, 8) consolePad.Parent = consoleScroll local function appendConsoleLog(msg: string, msgType: Enum.MessageType) local lbl = Instance.new("TextLabel") lbl.BackgroundTransparency = 1 lbl.AutomaticSize = Enum.AutomaticSize.Y lbl.Size = UDim2.new(1, 0, 0, 0) lbl.Text = msg lbl.Font = Enum.Font.Code lbl.TextSize = 11 lbl.TextWrapped = true lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.ZIndex = 22 if msgType == Enum.MessageType.MessageError then lbl.TextColor3 = Color3.fromRGB(255, 105, 105) elseif msgType == Enum.MessageType.MessageWarning then lbl.TextColor3 = Color3.fromRGB(255, 210, 95) else lbl.TextColor3 = Color3.fromRGB(215, 220, 235) end lbl.Parent = consoleScroll consoleScroll.CanvasSize = UDim2.fromOffset(0, consoleLayout.AbsoluteContentSize.Y + 14) consoleScroll.CanvasPosition = Vector2.new(0, math.max(0, consoleLayout.AbsoluteContentSize.Y - consoleScroll.AbsoluteWindowSize.Y + 14)) end for _, entry in ipairs(LogService:GetLogHistory()) do appendConsoleLog(entry.message, entry.messageType) end LogService.MessageOut:Connect(appendConsoleLog) consoleClose.MouseButton1Click:Connect(function() consoleWin.Visible = false end) ---------------------------------------------------------------- TAB 1: EDITOR + EXECUTOR local editorBox local setEditorStatus local openDocGlobal do local page = pages["Editor"] local subBar = Instance.new("Frame") subBar.Size = UDim2.new(1, -16, 0, 28) subBar.Position = UDim2.fromOffset(8, 8) subBar.BackgroundTransparency = 1 subBar.Parent = page local l = Instance.new("UIListLayout") l.FillDirection = Enum.FillDirection.Horizontal l.Padding = UDim.new(0, 4) l.SortOrder = Enum.SortOrder.LayoutOrder l.Parent = subBar local box = Instance.new("TextBox") box.Position = UDim2.fromOffset(8, 42) box.Size = UDim2.new(1, -16, 1, -86) box.BackgroundColor3 = BLACK box.TextColor3 = Color3.fromRGB(230, 230, 240) box.PlaceholderText = "-- Write Lua / loadstring here and press Execute" box.Font = Enum.Font.Code box.TextSize = 14 box.TextXAlignment = Enum.TextXAlignment.Left box.TextYAlignment = Enum.TextYAlignment.Top box.MultiLine = true box.ClearTextOnFocus = false box.TextWrapped = false box.Text = "" box.Parent = page corner(box, UDim.new(0, 8)) editorBox = box local actionBar = Instance.new("Frame") actionBar.Size = UDim2.new(1, -16, 0, 32) actionBar.AnchorPoint = Vector2.new(0, 1) actionBar.Position = UDim2.new(0, 8, 1, -6) actionBar.BackgroundTransparency = 1 actionBar.Parent = page local execBtn = Instance.new("TextButton") execBtn.Size = UDim2.fromOffset(92, 32) execBtn.BackgroundColor3 = ACCENT execBtn.Text = "Execute" execBtn.Font = Enum.Font.GothamBold execBtn.TextSize = 13 execBtn.TextColor3 = Color3.new(1, 1, 1) execBtn.Parent = actionBar corner(execBtn, UDim.new(0, 8)) registerAccent(execBtn, "BackgroundColor3") local clearBtn = Instance.new("TextButton") clearBtn.Size = UDim2.fromOffset(72, 32) clearBtn.Position = UDim2.fromOffset(98, 0) clearBtn.BackgroundColor3 = BLACK clearBtn.Text = "Clear" clearBtn.Font = Enum.Font.GothamMedium clearBtn.TextSize = 13 clearBtn.TextColor3 = Color3.new(1, 1, 1) clearBtn.Parent = actionBar corner(clearBtn, UDim.new(0, 8)) local statusLbl = Instance.new("TextLabel") statusLbl.Position = UDim2.fromOffset(178, 0) statusLbl.Size = UDim2.new(1, -178, 1, 0) statusLbl.BackgroundTransparency = 1 statusLbl.Text = "Ready" statusLbl.Font = Enum.Font.GothamMedium statusLbl.TextSize = 12 statusLbl.TextColor3 = MUTED statusLbl.TextXAlignment = Enum.TextXAlignment.Left statusLbl.TextTruncate = Enum.TextTruncate.AtEnd statusLbl.Parent = actionBar setEditorStatus = function(msg: string, isGood: boolean?) statusLbl.Text = msg statusLbl.TextColor3 = (isGood == false) and Color3.fromRGB(255, 110, 110) or MUTED end local docs, current, count = {}, nil, 0 local subButtons = {} local addBtn = Instance.new("TextButton") addBtn.Size = UDim2.fromOffset(28, 28) addBtn.BackgroundColor3 = ACCENT addBtn.Text = "+" addBtn.Font = Enum.Font.GothamBold addBtn.TextSize = 18 addBtn.TextColor3 = Color3.new(1, 1, 1) addBtn.LayoutOrder = 999 addBtn.Parent = subBar corner(addBtn, UDim.new(0, 8)) registerAccent(addBtn, "BackgroundColor3") local function refreshDocButtons() for i, b in pairs(subButtons) do b.BackgroundColor3 = (i == current) and ACCENT or BLACK end end local function openDoc(id) if current then docs[current] = box.Text end current = id box.Text = docs[id] or "" refreshDocButtons() end openDocGlobal = openDoc local function newDoc() count += 1 local id = count docs[id] = "" local b = Instance.new("TextButton") b.Size = UDim2.fromOffset(64, 28) b.BackgroundColor3 = BLACK b.Text = "Script " .. id b.Font = Enum.Font.GothamMedium b.TextSize = 12 b.TextColor3 = Color3.new(1, 1, 1) b.LayoutOrder = id b.Parent = subBar corner(b, UDim.new(0, 8)) subButtons[id] = b b.MouseButton1Click:Connect(function() openDoc(id) end) openDoc(id) end addBtn.MouseButton1Click:Connect(function() if count < 6 then newDoc() end end) execBtn.MouseButton1Click:Connect(function() local ok, info = executeCode(box.Text) setEditorStatus(info, ok) end) clearBtn.MouseButton1Click:Connect(function() box.Text = "" if current then docs[current] = "" end setEditorStatus("Cleared editor.", true) end) newDoc() end ---------------------------------------------------------------- TAB 2: TOOLS (own game) do local page = pages["Tools"] local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 8) layout.Parent = page local pad = Instance.new("UIPadding") pad.PaddingTop = UDim.new(0, 10) pad.PaddingLeft = UDim.new(0, 10) pad.PaddingRight = UDim.new(0, 10) pad.Parent = page local function button(text, cb) local b = Instance.new("TextButton") b.Size = UDim2.new(1, 0, 0, 36) b.BackgroundColor3 = BLACK b.Text = text b.Font = Enum.Font.GothamMedium b.TextSize = 14 b.TextColor3 = Color3.new(1, 1, 1) b.Parent = page corner(b, UDim.new(0, 8)) b.MouseButton1Click:Connect(function() cb(b) end) return b end local flying, conn, bv = false, nil, nil button("Fly: OFF", function(b) flying = not flying b.Text = flying and "Fly: ON" or "Fly: OFF" local char = player.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") local hum = char and char:FindFirstChildOfClass("Humanoid") if flying and hrp and hum then bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e5, 1e5, 1e5) bv.Velocity = Vector3.zero bv.Parent = hrp conn = RunService.RenderStepped:Connect(function() local cam = workspace.CurrentCamera if hum.MoveDirection.Magnitude > 0 then bv.Velocity = cam.CFrame.LookVector * 60 else bv.Velocity = Vector3.zero end end) else if conn then conn:Disconnect() end if bv then bv:Destroy() end end end) button("Teleport to Spawn", function() local char = player.Character local hrp = char and char:FindFirstChild("HumanoidRootPart") local spawn = workspace:FindFirstChildWhichIsA("SpawnLocation", true) if hrp and spawn then hrp.CFrame = spawn.CFrame + Vector3.new(0, 4, 0) end end) local speeds, idx = { 16, 32, 50, 80 }, 1 button("WalkSpeed: 16", function(b) idx = idx % #speeds + 1 local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = speeds[idx] end b.Text = "WalkSpeed: " .. speeds[idx] end) end ---------------------------------------------------------------- TAB 3: HUB (ScriptBlox + Offline Fallback) do local page = pages["Hub"] local offlinePresets = { { title = "Infinite Yield (Loader)", isUniversal = true, game = { name = "Universal Script" }, owner = { username = "EdgeIY" }, verified = true, script = "loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))()", }, { title = "Super Speed Boost", isUniversal = true, game = { name = "Universal Script" }, owner = { username = "LunarX" }, verified = true, script = "WalkSpeed = 60\nprint('WalkSpeed set to 60')", }, { title = "High Jump Boost", isUniversal = true, game = { name = "Universal Script" }, owner = { username = "LunarX" }, verified = true, script = "JumpPower = 100\nprint('JumpPower set to 100')", }, { title = "Quick Respawn", isUniversal = true, game = { name = "Universal Script" }, owner = { username = "LunarX" }, verified = true, script = "respawn()", }, { title = "Console Output Test", isUniversal = true, game = { name = "Universal Script" }, owner = { username = "LunarX" }, verified = true, script = "print('Lunar X keyless hub active!')\nwarn('No HTTP required for built-in scripts.')", }, } local searchRow = Instance.new("Frame") searchRow.Position = UDim2.fromOffset(10, 10) searchRow.Size = UDim2.new(1, -20, 0, 34) searchRow.BackgroundTransparency = 1 searchRow.Parent = page local searchBox = Instance.new("TextBox") searchBox.Size = UDim2.new(1, -92, 1, 0) searchBox.BackgroundColor3 = BLACK searchBox.TextColor3 = Color3.new(1, 1, 1) searchBox.PlaceholderText = "Search scripts (or leave blank for built-in)..." searchBox.Font = Enum.Font.GothamMedium searchBox.TextSize = 13 searchBox.ClearTextOnFocus = false searchBox.Text = "" searchBox.Parent = searchRow corner(searchBox, UDim.new(0, 8)) local searchBtn = Instance.new("TextButton") searchBtn.Size = UDim2.fromOffset(84, 34) searchBtn.Position = UDim2.new(1, -84, 0, 0) searchBtn.BackgroundColor3 = ACCENT searchBtn.Text = "Search" searchBtn.Font = Enum.Font.GothamBold searchBtn.TextSize = 13 searchBtn.TextColor3 = Color3.new(1, 1, 1) searchBtn.Parent = searchRow corner(searchBtn, UDim.new(0, 8)) registerAccent(searchBtn, "BackgroundColor3") local hubStatus = Instance.new("TextLabel") hubStatus.Position = UDim2.fromOffset(10, 48) hubStatus.Size = UDim2.new(1, -20, 0, 20) hubStatus.BackgroundTransparency = 1 hubStatus.Text = "Search ScriptBlox or press Search with empty box for built-in scripts." hubStatus.Font = Enum.Font.GothamMedium hubStatus.TextSize = 12 hubStatus.TextColor3 = MUTED hubStatus.TextXAlignment = Enum.TextXAlignment.Left hubStatus.TextTruncate = Enum.TextTruncate.AtEnd hubStatus.Parent = page local listFrame = Instance.new("ScrollingFrame") listFrame.Position = UDim2.fromOffset(10, 72) listFrame.Size = UDim2.new(1, -20, 1, -82) listFrame.BackgroundColor3 = BLACK listFrame.BorderSizePixel = 0 listFrame.ScrollBarThickness = 5 listFrame.CanvasSize = UDim2.fromOffset(0, 0) listFrame.Parent = page corner(listFrame, UDim.new(0, 8)) local listLayout = Instance.new("UIListLayout") listLayout.Padding = UDim.new(0, 6) listLayout.Parent = listFrame local listPad = Instance.new("UIPadding") listPad.PaddingTop = UDim.new(0, 6) listPad.PaddingLeft = UDim.new(0, 6) listPad.PaddingRight = UDim.new(0, 6) listPad.PaddingBottom = UDim.new(0, 6) listPad.Parent = listFrame listLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() listFrame.CanvasSize = UDim2.fromOffset(0, listLayout.AbsoluteContentSize.Y + 12) end) local function clearResults() for _, child in ipairs(listFrame:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end end local function httpGetSafe(url: string): (boolean, string) if type(request) == "function" then local ok, res = pcall(function() return request({ Url = url, Method = "GET" }) end) if ok and type(res) == "table" and type(res.Body) == "string" then return true, res.Body end end return pcall(function() return game:HttpGet(url) end) end local directUserKeys = { "username", "user_name", "creatorName", "creator_name", "author", "authorName", "author_name", "uploadedBy", "uploaded_by", "displayName", "display_name", "name", } local nestedUserTables = { "owner", "user", "creator", "authorInfo", "script", "data", "metadata", "result", } local function cleanUsername(raw: any): string? if type(raw) ~= "string" then return nil end local clean = raw:match("^%s*(.-)%s*$"):gsub("^@", "") if clean == "" then return nil end local lower = clean:lower() if lower == "unknown" or lower == "null" or lower == "nil" or lower == "anonymous" or lower == "guest" then return nil end return clean end local function extractCreatorFromNode(node, depth: number): string? if type(node) == "string" then local handle = node:match("@([%w_%.%-]+)") if handle then return cleanUsername(handle) end return cleanUsername(node) end if type(node) ~= "table" or depth > 4 then return nil end for _, key in ipairs(directUserKeys) do local found = cleanUsername(node[key]) if found then return found end end for _, subKey in ipairs(nestedUserTables) do local subVal = node[subKey] if type(subVal) == "table" or type(subVal) == "string" then local found = extractCreatorFromNode(subVal, depth + 1) if found then return found end end end return nil end local creatorCache = {} local function getCreatorName(item): string local direct = extractCreatorFromNode(item, 0) if direct then return direct end local slugOrId = tostring(item.slug or item._id or "") if slugOrId ~= "" then if creatorCache[slugOrId] then return creatorCache[slugOrId] end local detailUrl = "https://scriptblox.com/api/script/" .. HttpService:UrlEncode(slugOrId) local ok, rawDetail = httpGetSafe(detailUrl) if ok and type(rawDetail) == "string" then local decodedOk, decoded = pcall(function() return HttpService:JSONDecode(rawDetail) end) if decodedOk and type(decoded) == "table" then local fetchedName = extractCreatorFromNode(decoded, 0) if fetchedName then creatorCache[slugOrId] = fetchedName return fetchedName end end end end return "ScriptBlox User" end local function getGameOrTypeLabel(item): string local rawGame = (type(item.game) == "table" and item.game.name) or nil if item.isUniversal == true or not rawGame or rawGame == "" or tostring(rawGame):lower():find("universal", 1, true) then return "Universal Script" end return tostring(rawGame) end local function scoreScript(item, queryLower: string): number if queryLower == "" then return 10 end local titleStr = tostring(item.title or ""):lower() local gameStr = getGameOrTypeLabel(item):lower() local creatorStr = getCreatorName(item):lower() local score = 0 if titleStr == queryLower then score += 100 elseif titleStr:find(queryLower, 1, true) then score += 60 end if gameStr == queryLower or creatorStr == queryLower then score += 40 elseif gameStr:find(queryLower, 1, true) or creatorStr:find(queryLower, 1, true) then score += 20 end for word in queryLower:gmatch("%S+") do if #word >= 2 then if titleStr:find(word, 1, true) then score += 15 end if gameStr:find(word, 1, true) or creatorStr:find(word, 1, true) then score += 8 end end end if item.verified == true then score += 5 end return score end local function rankScripts(rawList, query: string) local queryLower = query:lower() local ranked = {} for _, item in ipairs(rawList) do if type(item) == "table" and type(item.title) == "string" and item.title ~= "" then local s = scoreScript(item, queryLower) if queryLower == "" or s > 0 then table.insert(ranked, { item = item, score = s }) end end end table.sort(ranked, function(a, b) if a.score == b.score then return tostring(a.item.title) < tostring(b.item.title) end return a.score > b.score end) local sortedItems = {} for _, entry in ipairs(ranked) do table.insert(sortedItems, entry.item) end return sortedItems end local function fetchRawScript(slugOrId: string): string? if not slugOrId or slugOrId == "" then return nil end local rawUrl = "https://scriptblox.com/api/script/raw/" .. HttpService:UrlEncode(slugOrId) local ok, rawRes = httpGetSafe(rawUrl) if ok and type(rawRes) == "string" then local decodedOk, decoded = pcall(function() return HttpService:JSONDecode(rawRes) end) if decodedOk and type(decoded) == "table" and type(decoded.script) == "string" then return decoded.script end return rawRes end return nil end local function addResultCard(item) local card = Instance.new("Frame") card.Size = UDim2.new(1, 0, 0, 52) card.BackgroundColor3 = DARK card.BorderSizePixel = 0 card.Parent = listFrame corner(card, UDim.new(0, 8)) local titleLbl = Instance.new("TextLabel") titleLbl.Position = UDim2.fromOffset(10, 6) titleLbl.Size = UDim2.new(1, -138, 0, 20) titleLbl.BackgroundTransparency = 1 titleLbl.Text = tostring(item.title or "Untitled Script") titleLbl.Font = Enum.Font.GothamBold titleLbl.TextSize = 13 titleLbl.TextColor3 = Color3.new(1, 1, 1) titleLbl.TextXAlignment = Enum.TextXAlignment.Left titleLbl.TextTruncate = Enum.TextTruncate.AtEnd titleLbl.Parent = card local subLbl = Instance.new("TextLabel") subLbl.Position = UDim2.fromOffset(10, 26) subLbl.Size = UDim2.new(1, -138, 0, 18) subLbl.BackgroundTransparency = 1 subLbl.Text = getGameOrTypeLabel(item) .. " • " .. getCreatorName(item) subLbl.Font = Enum.Font.GothamMedium subLbl.TextSize = 11 subLbl.TextColor3 = MUTED subLbl.TextXAlignment = Enum.TextXAlignment.Left subLbl.TextTruncate = Enum.TextTruncate.AtEnd subLbl.Parent = card local loadBtn = Instance.new("TextButton") loadBtn.Size = UDim2.fromOffset(54, 28) loadBtn.Position = UDim2.new(1, -120, 0.5, -14) loadBtn.BackgroundColor3 = BLACK loadBtn.Text = "Load" loadBtn.Font = Enum.Font.GothamBold loadBtn.TextSize = 12 loadBtn.TextColor3 = Color3.new(1, 1, 1) loadBtn.Parent = card corner(loadBtn, UDim.new(0, 6)) local runBtn = Instance.new("TextButton") runBtn.Size = UDim2.fromOffset(54, 28) runBtn.Position = UDim2.new(1, -60, 0.5, -14) runBtn.BackgroundColor3 = ACCENT runBtn.Text = "Run" runBtn.Font = Enum.Font.GothamBold runBtn.TextSize = 12 runBtn.TextColor3 = Color3.new(1, 1, 1) runBtn.Parent = card corner(runBtn, UDim.new(0, 6)) registerAccent(runBtn, "BackgroundColor3") local function resolveScriptText(): string if type(item.script) == "string" and item.script ~= "" then return item.script end local fetched = fetchRawScript(tostring(item.slug or item._id or "")) if fetched then return fetched end return "-- Script title: " .. tostring(item.title or "Script") .. "\nprint(\"Loaded from ScriptBlox: " .. tostring(item.title or "") .. "\")" end loadBtn.MouseButton1Click:Connect(function() local codeText = resolveScriptText() if editorBox then editorBox.Text = codeText end if openDocGlobal then openDocGlobal(1) editorBox.Text = codeText end selectTab("Editor") if setEditorStatus then setEditorStatus("Loaded \"" .. tostring(item.title or "Script") .. "\" into Editor.", true) end end) runBtn.MouseButton1Click:Connect(function() local codeText = resolveScriptText() local ok, info = executeCode(codeText) hubStatus.Text = info hubStatus.TextColor3 = ok and MUTED or Color3.fromRGB(255, 110, 110) end) end local function showFallbackPresets(q: string, reasonText: string?) clearResults() local matching = rankScripts(offlinePresets, q) if #matching == 0 then matching = offlinePresets end for _, preset in ipairs(matching) do addResultCard(preset) end hubStatus.Text = (reasonText and (reasonText .. " • ") or "") .. "Showing " .. #matching .. " built-in scripts." hubStatus.TextColor3 = MUTED end local onCooldown = false local COOLDOWN_SECONDS = 1 local function startSearchCooldown() onCooldown = true searchBtn.Active = false searchBtn.BackgroundColor3 = DARK searchBtn.Text = "Wait 1s" task.wait(COOLDOWN_SECONDS) onCooldown = false searchBtn.Active = true searchBtn.BackgroundColor3 = ACCENT searchBtn.Text = "Search" end local function runSearch() if onCooldown then hubStatus.Text = "Please wait 1 second between searches to avoid rate limits." hubStatus.TextColor3 = Color3.fromRGB(255, 110, 110) return end local q = searchBox.Text:match("^%s*(.-)%s*$") task.spawn(startSearchCooldown) if q == "" then showFallbackPresets("", "Built-in catalog") return end hubStatus.Text = "Searching ScriptBlox for \"" .. q .. "\"..." hubStatus.TextColor3 = MUTED clearResults() local url = "https://scriptblox.com/api/script/search?q=" .. HttpService:UrlEncode(q) local ok, rawJson = httpGetSafe(url) if not ok or type(rawJson) ~= "string" then showFallbackPresets(q, "HTTP unavailable") return end local decodedOk, data = pcall(function() return HttpService:JSONDecode(rawJson) end) local scriptsList = decodedOk and type(data) == "table" and type(data.result) == "table" and data.result.scripts if type(scriptsList) ~= "table" or #scriptsList == 0 then showFallbackPresets(q, "No online match") return end local sorted = rankScripts(scriptsList, q) hubStatus.Text = "Found " .. #sorted .. " results for \"" .. q .. "\"." for _, item in ipairs(sorted) do addResultCard(item) end end searchBtn.MouseButton1Click:Connect(runSearch) searchBox.FocusLost:Connect(function(enterPressed) if enterPressed then runSearch() end end) showFallbackPresets("", "Ready") end ---------------------------------------------------------------- TAB 4: ESP (VISUALS) do local page = pages["ESP"] local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 8) layout.Parent = page local pad = Instance.new("UIPadding") pad.PaddingTop = UDim.new(0, 10) pad.PaddingBottom = UDim.new(0, 10) pad.PaddingLeft = UDim.new(0, 10) pad.PaddingRight = UDim.new(0, 10) pad.Parent = page local headerLbl = Instance.new("TextLabel") headerLbl.Size = UDim2.new(1, 0, 0, 20) headerLbl.BackgroundTransparency = 1 headerLbl.Text = "👁️ ESP & Visuals" headerLbl.Font = Enum.Font.GothamBold headerLbl.TextSize = 14 headerLbl.TextColor3 = ACCENT headerLbl.TextXAlignment = Enum.TextXAlignment.Left headerLbl.Parent = page registerAccent(headerLbl, "TextColor3") local function makeToggle(labelText: string, onClick: (btn: TextButton) -> ()) local b = Instance.new("TextButton") b.Size = UDim2.new(1, 0, 0, 34) b.BackgroundColor3 = BLACK b.Text = labelText b.Font = Enum.Font.GothamBold b.TextSize = 13 b.TextColor3 = Color3.new(1, 1, 1) b.Parent = page corner(b, UDim.new(0, 8)) b.MouseButton1Click:Connect(function() onClick(b) end) return b end local statusLbl = Instance.new("TextLabel") statusLbl.Size = UDim2.new(1, 0, 0, 20) statusLbl.BackgroundTransparency = 1 statusLbl.Text = "Visuals ready." statusLbl.Font = Enum.Font.GothamMedium statusLbl.TextSize = 12 statusLbl.TextColor3 = MUTED statusLbl.TextXAlignment = Enum.TextXAlignment.Left statusLbl.Parent = page -- 1. Player ESP (Highlights + Name & Stud Distance) local espEnabled = false local espEntries = {} local espLoopConn = nil local playerAddedConn = nil local function isCharacterPart(inst: Instance): boolean for _, plr in ipairs(Players:GetPlayers()) do if plr.Character and inst:IsDescendantOf(plr.Character) then return true end end return false end local function clearPlayerEsp() if espLoopConn then espLoopConn:Disconnect() espLoopConn = nil end if playerAddedConn then playerAddedConn:Disconnect() playerAddedConn = nil end for _, entry in pairs(espEntries) do if entry.highlight then entry.highlight:Destroy() end if entry.billboard then entry.billboard:Destroy() end end table.clear(espEntries) end local function attachEspToPlayer(plr: Player) if plr == player then return end local function applyToChar(char: Model) if not espEnabled then return end local head = char:FindFirstChild("Head") or char:WaitForChild("Head", 5) if not head or not head:IsA("BasePart") then return end if espEntries[plr] then if espEntries[plr].highlight then espEntries[plr].highlight:Destroy() end if espEntries[plr].billboard then espEntries[plr].billboard:Destroy() end end local hl = Instance.new("Highlight") hl.Name = "LunarESP_Highlight" hl.Adornee = char hl.FillColor = ACCENT hl.FillTransparency = 0.65 hl.OutlineColor = Color3.new(1, 1, 1) hl.OutlineTransparency = 0.15 hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop hl.Parent = gui local bb = Instance.new("BillboardGui") bb.Name = "LunarESP_Tag" bb.Adornee = head bb.Size = UDim2.fromOffset(140, 28) bb.StudsOffset = Vector3.new(0, 2.2, 0) bb.AlwaysOnTop = true bb.Parent = gui local tagLbl = Instance.new("TextLabel") tagLbl.Size = UDim2.fromScale(1, 1) tagLbl.BackgroundTransparency = 1 tagLbl.Text = plr.Name tagLbl.Font = Enum.Font.GothamBold tagLbl.TextSize = 12 tagLbl.TextColor3 = Color3.new(1, 1, 1) tagLbl.TextStrokeTransparency = 0.25 tagLbl.Parent = bb espEntries[plr] = { highlight = hl, billboard = bb, label = tagLbl, char = char } end if plr.Character then task.spawn(applyToChar, plr.Character) end plr.CharacterAdded:Connect(function(c) if espEnabled then task.spawn(applyToChar, c) end end) end local function enablePlayerEsp() clearPlayerEsp() for _, plr in ipairs(Players:GetPlayers()) do attachEspToPlayer(plr) end playerAddedConn = Players.PlayerAdded:Connect(attachEspToPlayer) espLoopConn = RunService.RenderStepped:Connect(function() local myChar = player.Character local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart") for plr, entry in pairs(espEntries) do if not plr.Parent then if entry.highlight then entry.highlight:Destroy() end if entry.billboard then entry.billboard:Destroy() end espEntries[plr] = nil else if entry.highlight then entry.highlight.FillColor = ACCENT end local targetChar = plr.Character local targetRoot = targetChar and targetChar:FindFirstChild("HumanoidRootPart") if entry.label and myRoot and targetRoot then local dist = math.floor((myRoot.Position - targetRoot.Position).Magnitude) entry.label.Text = string.format("%s [%d]", plr.Name, dist) end end end end) end makeToggle("Player ESP: OFF", function(btn) espEnabled = not espEnabled btn.Text = espEnabled and "Player ESP: ON" or "Player ESP: OFF" if espEnabled then enablePlayerEsp() statusLbl.Text = "Player ESP active (highlights + distance)." else clearPlayerEsp() statusLbl.Text = "Player ESP turned off." end end) -- 2. See Thru Walls (X-Ray) local xrayEnabled = false local savedModifiers = {} local function setSeeThruWalls(active: boolean) if active then table.clear(savedModifiers) for _, desc in ipairs(workspace:GetDescendants()) do if desc:IsA("BasePart") and not isCharacterPart(desc) and desc.Transparency < 0.95 then savedModifiers[desc] = desc.LocalTransparencyModifier desc.LocalTransparencyModifier = 0.72 end end else for part, prevMod in pairs(savedModifiers) do if part and part.Parent then part.LocalTransparencyModifier = prevMod or 0 end end table.clear(savedModifiers) end end makeToggle("See Thru Walls (X-Ray): OFF", function(btn) xrayEnabled = not xrayEnabled btn.Text = xrayEnabled and "See Thru Walls (X-Ray): ON" or "See Thru Walls (X-Ray): OFF" setSeeThruWalls(xrayEnabled) statusLbl.Text = xrayEnabled and "See-thru walls enabled." or "Restored wall visibility." end) -- 3. Fullbright local fullbrightEnabled = false local savedLighting = { Brightness = Lighting.Brightness, ClockTime = Lighting.ClockTime, GlobalShadows = Lighting.GlobalShadows, Ambient = Lighting.Ambient, } makeToggle("Fullbright: OFF", function(btn) fullbrightEnabled = not fullbrightEnabled btn.Text = fullbrightEnabled and "Fullbright: ON" or "Fullbright: OFF" if fullbrightEnabled then savedLighting.Brightness = Lighting.Brightness savedLighting.ClockTime = Lighting.ClockTime savedLighting.GlobalShadows = Lighting.GlobalShadows savedLighting.Ambient = Lighting.Ambient Lighting.Brightness = 3 Lighting.ClockTime = 14 Lighting.GlobalShadows = false Lighting.Ambient = Color3.fromRGB(200, 200, 210) statusLbl.Text = "Fullbright enabled." else Lighting.Brightness = savedLighting.Brightness Lighting.ClockTime = savedLighting.ClockTime Lighting.GlobalShadows = savedLighting.GlobalShadows Lighting.Ambient = savedLighting.Ambient statusLbl.Text = "Restored lighting." end end) -- 4. FOV Changer local fovValues = { 70, 90, 105, 120 } local fovIdx = 1 makeToggle("FOV: 70", function(btn) fovIdx = (fovIdx % #fovValues) + 1 local newFov = fovValues[fovIdx] local cam = workspace.CurrentCamera if cam then cam.FieldOfView = newFov end btn.Text = "FOV: " .. newFov statusLbl.Text = "Camera FOV set to " .. newFov .. "." end) end ---------------------------------------------------------------- TAB 5: SB (ACTUALLY SMART SCRIPT BOT) do local page = pages["SB"] local lastGeneratedScript = "" local lastTopic = "general" local lastNumber: number? = nil local chatHistory = {} local topBar = Instance.new("Frame") topBar.Position = UDim2.fromOffset(10, 6) topBar.Size = UDim2.new(1, -20, 0, 22) topBar.BackgroundTransparency = 1 topBar.Parent = page local headerLbl = Instance.new("TextLabel") headerLbl.Size = UDim2.new(1, -74, 1, 0) headerLbl.BackgroundTransparency = 1 headerLbl.Text = "🤖 ScriptBot v3 — GUI & Luau script builder" headerLbl.Font = Enum.Font.GothamBold headerLbl.TextSize = 12 headerLbl.TextColor3 = ACCENT headerLbl.TextXAlignment = Enum.TextXAlignment.Left headerLbl.TextTruncate = Enum.TextTruncate.AtEnd headerLbl.Parent = topBar registerAccent(headerLbl, "TextColor3") local clearChatBtn = Instance.new("TextButton") clearChatBtn.Size = UDim2.fromOffset(68, 22) clearChatBtn.Position = UDim2.new(1, -68, 0, 0) clearChatBtn.BackgroundColor3 = BLACK clearChatBtn.Text = "Clear Chat" clearChatBtn.Font = Enum.Font.GothamBold clearChatBtn.TextSize = 10 clearChatBtn.TextColor3 = MUTED clearChatBtn.Parent = topBar corner(clearChatBtn, UDim.new(0, 6)) local chatScroll = Instance.new("ScrollingFrame") chatScroll.Position = UDim2.fromOffset(10, 32) chatScroll.Size = UDim2.new(1, -20, 1, -82) chatScroll.BackgroundColor3 = BLACK chatScroll.BorderSizePixel = 0 chatScroll.ScrollBarThickness = 5 chatScroll.CanvasSize = UDim2.fromOffset(0, 0) chatScroll.Parent = page corner(chatScroll, UDim.new(0, 8)) local chatLayout = Instance.new("UIListLayout") chatLayout.Padding = UDim.new(0, 8) chatLayout.Parent = chatScroll local chatPad = Instance.new("UIPadding") chatPad.PaddingTop = UDim.new(0, 8) chatPad.PaddingLeft = UDim.new(0, 8) chatPad.PaddingRight = UDim.new(0, 8) chatPad.PaddingBottom = UDim.new(0, 8) chatPad.Parent = chatScroll chatLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() chatScroll.CanvasSize = UDim2.fromOffset(0, chatLayout.AbsoluteContentSize.Y + 16) chatScroll.CanvasPosition = Vector2.new(0, math.max(0, chatLayout.AbsoluteContentSize.Y - chatScroll.AbsoluteWindowSize.Y + 16)) end) local function addChatMessage(sender: string, text: string, generatedCode: string?) table.insert(chatHistory, { sender = sender, text = text, code = generatedCode }) if #chatHistory > 20 then table.remove(chatHistory, 1) end local isUser = (sender == "You") local msgFrame = Instance.new("Frame") msgFrame.BackgroundColor3 = isUser and Color3.fromRGB(34, 24, 48) or DARK msgFrame.BorderSizePixel = 0 msgFrame.AutomaticSize = Enum.AutomaticSize.Y msgFrame.Size = UDim2.new(1, 0, 0, 0) msgFrame.Parent = chatScroll corner(msgFrame, UDim.new(0, 8)) local mPad = Instance.new("UIPadding") mPad.PaddingTop = UDim.new(0, 6) mPad.PaddingBottom = UDim.new(0, 6) mPad.PaddingLeft = UDim.new(0, 8) mPad.PaddingRight = UDim.new(0, 8) mPad.Parent = msgFrame local mLayout = Instance.new("UIListLayout") mLayout.Padding = UDim.new(0, 4) mLayout.Parent = msgFrame local authorLbl = Instance.new("TextLabel") authorLbl.BackgroundTransparency = 1 authorLbl.Size = UDim2.new(1, 0, 0, 16) authorLbl.Text = isUser and ("🧑 " .. sender) or ("🤖 ScriptBot") authorLbl.Font = Enum.Font.GothamBold authorLbl.TextSize = 11 authorLbl.TextColor3 = isUser and Color3.fromRGB(215, 175, 255) or ACCENT authorLbl.TextXAlignment = Enum.TextXAlignment.Left authorLbl.Parent = msgFrame if not isUser then registerAccent(authorLbl, "TextColor3") end local bodyLbl = Instance.new("TextLabel") bodyLbl.BackgroundTransparency = 1 bodyLbl.AutomaticSize = Enum.AutomaticSize.Y bodyLbl.Size = UDim2.new(1, 0, 0, 0) bodyLbl.Text = text bodyLbl.Font = Enum.Font.GothamMedium bodyLbl.TextSize = 12 bodyLbl.TextColor3 = Color3.new(1, 1, 1) bodyLbl.TextWrapped = true bodyLbl.TextXAlignment = Enum.TextXAlignment.Left bodyLbl.Parent = msgFrame if generatedCode and generatedCode ~= "" then lastGeneratedScript = generatedCode local codeBox = Instance.new("TextLabel") codeBox.BackgroundColor3 = BLACK codeBox.AutomaticSize = Enum.AutomaticSize.Y codeBox.Size = UDim2.new(1, 0, 0, 0) codeBox.Text = generatedCode codeBox.Font = Enum.Font.Code codeBox.TextSize = 11 codeBox.TextColor3 = Color3.fromRGB(190, 255, 210) codeBox.TextWrapped = true codeBox.TextXAlignment = Enum.TextXAlignment.Left codeBox.Parent = msgFrame corner(codeBox, UDim.new(0, 6)) local cPad = Instance.new("UIPadding") cPad.PaddingTop = UDim.new(0, 6) cPad.PaddingBottom = UDim.new(0, 6) cPad.PaddingLeft = UDim.new(0, 6) cPad.PaddingRight = UDim.new(0, 6) cPad.Parent = codeBox local btnRow = Instance.new("Frame") btnRow.BackgroundTransparency = 1 btnRow.Size = UDim2.new(1, 0, 0, 26) btnRow.Parent = msgFrame local loadCodeBtn = Instance.new("TextButton") loadCodeBtn.Size = UDim2.fromOffset(96, 26) loadCodeBtn.BackgroundColor3 = BLACK loadCodeBtn.Text = "Load to Editor" loadCodeBtn.Font = Enum.Font.GothamBold loadCodeBtn.TextSize = 11 loadCodeBtn.TextColor3 = Color3.new(1, 1, 1) loadCodeBtn.Parent = btnRow corner(loadCodeBtn, UDim.new(0, 6)) local runCodeBtn = Instance.new("TextButton") runCodeBtn.Size = UDim2.fromOffset(64, 26) runCodeBtn.Position = UDim2.fromOffset(102, 0) runCodeBtn.BackgroundColor3 = ACCENT runCodeBtn.Text = "Run Now" runCodeBtn.Font = Enum.Font.GothamBold runCodeBtn.TextSize = 11 runCodeBtn.TextColor3 = Color3.new(1, 1, 1) runCodeBtn.Parent = btnRow corner(runCodeBtn, UDim.new(0, 6)) registerAccent(runCodeBtn, "BackgroundColor3") loadCodeBtn.MouseButton1Click:Connect(function() if editorBox then editorBox.Text = generatedCode end if openDocGlobal then openDocGlobal(1) editorBox.Text = generatedCode end selectTab("Editor") if setEditorStatus then setEditorStatus("Loaded ScriptBot code into Editor.", true) end end) runCodeBtn.MouseButton1Click:Connect(function() local ok, info = executeCode(generatedCode) addChatMessage("Bot", (ok and "✅ " or "⚠️ ") .. info, nil) end) end end clearChatBtn.MouseButton1Click:Connect(function() for _, child in ipairs(chatScroll:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end table.clear(chatHistory) lastGeneratedScript = "" lastTopic = "general" lastNumber = nil addChatMessage("Bot", "Welcome to ScriptBot v3", nil) end) local function detectTopic(text: string): string local s = text:lower() if s:find("username", 1, true) or s:find("lookup", 1, true) or s:find("player info", 1, true) or s:find("join date", 1, true) then return "player_gui" end if s:find("gui", 1, true) or s:find("ui", 1, true) or s:find("menu", 1, true) or s:find("screen", 1, true) then return "gui" end if s:find("fly", 1, true) or s:find("flight", 1, true) then return "fly" end if s:find("inf jump", 1, true) or s:find("infinite jump", 1, true) then return "infjump" end if s:find("speed", 1, true) or s:find("walkspeed", 1, true) or s:find("fast", 1, true) or s:find("faster", 1, true) then return "speed" end if s:find("jump", 1, true) or s:find("jumppower", 1, true) or s:find("higher", 1, true) then return "jump" end if s:find("noclip", 1, true) or s:find("no clip", 1, true) then return "noclip" end if s:find("esp", 1, true) or s:find("highlight", 1, true) or s:find("wallhack", 1, true) then return "esp" end if s:find("xray", 1, true) or s:find("see thru", 1, true) or s:find("see through", 1, true) then return "xray" end if s:find("invisible", 1, true) or s:find("invis", 1, true) or s:find("ghost", 1, true) then return "invisible" end if s:find("afk", 1, true) or s:find("anti-afk", 1, true) or s:find("antiafk", 1, true) then return "antiafk" end if s:find("tp", 1, true) or s:find("teleport", 1, true) then return "teleport" end return "general" end local function createScriptByTopic(topic: string, promptText: string, numVal: number?): string if topic == "player_gui" then return [[ local Players = game:GetService("Players") local lp = Players.LocalPlayer local sg = Instance.new("ScreenGui") sg.Name = "PlayerLookupGui" sg.ResetOnSpawn = false sg.Parent = lp:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.fromOffset(270, 175) frame.Position = UDim2.new(0.5, -135, 0.5, -87) frame.BackgroundColor3 = Color3.fromRGB(16, 16, 22) frame.BorderSizePixel = 0 frame.Parent = sg Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 12) local titleLbl = Instance.new("TextLabel") titleLbl.Size = UDim2.new(1, -16, 0, 26) titleLbl.Position = UDim2.fromOffset(8, 6) titleLbl.BackgroundTransparency = 1 titleLbl.Text = "Player Info Lookup" titleLbl.Font = Enum.Font.GothamBold titleLbl.TextSize = 14 titleLbl.TextColor3 = Color3.fromRGB(185, 110, 255) titleLbl.TextXAlignment = Enum.TextXAlignment.Left titleLbl.Parent = frame local box = Instance.new("TextBox") box.Size = UDim2.new(1, -92, 0, 28) box.Position = UDim2.fromOffset(8, 36) box.BackgroundColor3 = Color3.fromRGB(0, 0, 0) box.TextColor3 = Color3.new(1, 1, 1) box.PlaceholderText = "Enter username..." box.Font = Enum.Font.GothamMedium box.TextSize = 12 box.ClearTextOnFocus = false box.Parent = frame Instance.new("UICorner", box).CornerRadius = UDim.new(0, 8) local btn = Instance.new("TextButton") btn.Size = UDim2.fromOffset(72, 28) btn.Position = UDim2.new(1, -80, 0, 36) btn.BackgroundColor3 = Color3.fromRGB(170, 70, 255) btn.TextColor3 = Color3.new(1, 1, 1) btn.Text = "Check" btn.Font = Enum.Font.GothamBold btn.TextSize = 12 btn.Parent = frame Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 8) local infoLbl = Instance.new("TextLabel") infoLbl.Size = UDim2.new(1, -16, 1, -76) infoLbl.Position = UDim2.fromOffset(8, 70) infoLbl.BackgroundTransparency = 1 infoLbl.TextColor3 = Color3.fromRGB(220, 220, 235) infoLbl.Font = Enum.Font.GothamMedium infoLbl.TextSize = 12 infoLbl.TextWrapped = true infoLbl.TextXAlignment = Enum.TextXAlignment.Left infoLbl.TextYAlignment = Enum.TextYAlignment.Top infoLbl.Text = "Type a username in the server and press Check.\n(Note: join history & past games require external/server APIs)" infoLbl.Parent = frame btn.MouseButton1Click:Connect(function() local q = box.Text:match("^%s*(.-)%s*$"):lower() if q == "" then infoLbl.Text = "Enter a username first." return end local found for _, plr in ipairs(Players:GetPlayers()) do if plr.Name:lower():find(q, 1, true) or plr.DisplayName:lower():find(q, 1, true) then found = plr break end end if found then local hp = found.Character and found.Character:FindFirstChildOfClass("Humanoid") infoLbl.Text = string.format( "User: %s (@%s)\nUserId: %d\nAccount Age: %d days\nTeam: %s\nHealth: %s", found.DisplayName, found.Name, found.UserId, found.AccountAge, found.Team and found.Team.Name or "None", hp and math.floor(hp.Health) or "N/A" ) else infoLbl.Text = "Player not currently in this server." end end) print("PlayerLookupGui created")]] elseif topic == "gui" then local guiTitle = promptText:match("gui%s+for%s+([%w_ ]+)") or promptText:match("([%w_]+)%s+gui") or "Custom GUI" return string.format([[ local Players = game:GetService("Players") local lp = Players.LocalPlayer local sg = Instance.new("ScreenGui") sg.Name = "LunarCustomGui" sg.ResetOnSpawn = false sg.Parent = lp:WaitForChild("PlayerGui") local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.fromOffset(230, 130) mainFrame.Position = UDim2.new(0.5, -115, 0.5, -65) mainFrame.BackgroundColor3 = Color3.fromRGB(16, 16, 22) mainFrame.BorderSizePixel = 0 mainFrame.Parent = sg Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 12) local header = Instance.new("TextLabel") header.Size = UDim2.new(1, -16, 0, 28) header.Position = UDim2.fromOffset(8, 6) header.BackgroundTransparency = 1 header.Text = "%s" header.Font = Enum.Font.GothamBold header.TextSize = 14 header.TextColor3 = Color3.fromRGB(185, 110, 255) header.Parent = mainFrame local actionBtn = Instance.new("TextButton") actionBtn.Size = UDim2.new(1, -24, 0, 34) actionBtn.Position = UDim2.fromOffset(12, 46) actionBtn.BackgroundColor3 = Color3.fromRGB(170, 70, 255) actionBtn.TextColor3 = Color3.new(1, 1, 1) actionBtn.Text = "Run Action" actionBtn.Font = Enum.Font.GothamBold actionBtn.TextSize = 13 actionBtn.Parent = mainFrame Instance.new("UICorner", actionBtn).CornerRadius = UDim.new(0, 8) actionBtn.MouseButton1Click:Connect(function() local hum = lp.Character and lp.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = 40 end print("GUI button clicked!") end) print("Custom GUI created")]], guiTitle) elseif topic == "fly" then local spd = numVal or lastNumber or 65 return string.format([[ local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local speed = %d local function startFly() local char = player.Character or player.CharacterAdded:Wait() local hrp = char:WaitForChild("HumanoidRootPart") local hum = char:WaitForChild("Humanoid") local bv = Instance.new("BodyVelocity") bv.MaxForce = Vector3.new(1e5, 1e5, 1e5) bv.Velocity = Vector3.zero bv.Parent = hrp RunService.RenderStepped:Connect(function() local cam = workspace.CurrentCamera if hum.MoveDirection.Magnitude > 0 and cam then bv.Velocity = cam.CFrame.LookVector * speed else bv.Velocity = Vector3.zero end end) end startFly() print("Fly active at speed " .. speed)]], spd) elseif topic == "speed" then local spd = numVal or (lastNumber and (lastNumber + 15)) or 60 return string.format([[ local Players = game:GetService("Players") local player = Players.LocalPlayer local targetSpeed = %d WalkSpeed = targetSpeed local function applySpeed(char) local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = targetSpeed end end applySpeed(player.Character) player.CharacterAdded:Connect(applySpeed) print("WalkSpeed set to " .. targetSpeed)]], spd) elseif topic == "jump" then local jp = numVal or (lastNumber and (lastNumber + 25)) or 100 return string.format([[ local Players = game:GetService("Players") local player = Players.LocalPlayer local targetJump = %d JumpPower = targetJump local function applyJump(char) local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then hum.UseJumpPower = true hum.JumpPower = targetJump end end applyJump(player.Character) player.CharacterAdded:Connect(applyJump) print("JumpPower set to " .. targetJump)]], jp) elseif topic == "infjump" then return [[ local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local player = Players.LocalPlayer UserInputService.JumpRequest:Connect(function() local char = player.Character local hum = char and char:FindFirstChildOfClass("Humanoid") if hum then hum:ChangeState(Enum.HumanoidStateType.Jumping) end end) print("Infinite Jump enabled")]] elseif topic == "noclip" then return [[ local RunService = game:GetService("RunService") local Players = game:GetService("Players") local player = Players.LocalPlayer RunService.Stepped:Connect(function() local char = player.Character if char then for _, part in ipairs(char:GetDescendants()) do if part:IsA("BasePart") then part.CanCollide = false end end end end) print("Noclip enabled")]] elseif topic == "esp" then return [[ local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer local function highlightPlayer(plr) if plr == localPlayer or not plr.Character then return end if not plr.Character:FindFirstChild("LunarESP") then local hl = Instance.new("Highlight") hl.Name = "LunarESP" hl.OutlineColor = Color3.new(1, 1, 1) hl.FillTransparency = 0.65 hl.Parent = plr.Character end end for _, plr in ipairs(Players:GetPlayers()) do highlightPlayer(plr) end Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function() task.wait(0.3) highlightPlayer(plr) end) end) print("ESP enabled")]] elseif topic == "xray" then local trans = (numVal and math.clamp(numVal / 100, 0.1, 0.95)) or 0.72 return string.format([[ local Players = game:GetService("Players") local function isCharPart(obj) for _, plr in ipairs(Players:GetPlayers()) do if plr.Character and obj:IsDescendantOf(plr.Character) then return true end end return false end for _, v in ipairs(workspace:GetDescendants()) do if v:IsA("BasePart") and not isCharPart(v) and v.Transparency < 0.95 then v.LocalTransparencyModifier = %.2f end end print("X-Ray applied")]], trans) elseif topic == "invisible" then return [[ local Players = game:GetService("Players") local char = Players.LocalPlayer.Character if char then for _, obj in ipairs(char:GetDescendants()) do if obj:IsA("BasePart") or obj:IsA("Decal") then obj.Transparency = 1 end end end print("Character transparency set to 1")]] elseif topic == "antiafk" then return [[ local Players = game:GetService("Players") local VirtualUser = game:GetService("VirtualUser") local player = Players.LocalPlayer player.Idled:Connect(function() VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new()) end) print("Anti-AFK active")]] elseif topic == "teleport" then local targetName = promptText:match("[Tt][Oo]%s+([%w_]+)") if targetName and targetName:lower() ~= "spawn" then return string.format([[ local Players = game:GetService("Players") local me = Players.LocalPlayer local target for _, plr in ipairs(Players:GetPlayers()) do if plr.Name:lower():find("%s", 1, true) or plr.DisplayName:lower():find("%s", 1, true) then target = plr break end end if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") and me.Character and me.Character:FindFirstChild("HumanoidRootPart") then me.Character.HumanoidRootPart.CFrame = target.Character.HumanoidRootPart.CFrame + Vector3.new(0, 3, 0) print("Teleported to " .. target.Name) else warn("Target player not found") end]], targetName:lower(), targetName:lower()) end return [[ local Players = game:GetService("Players") local me = Players.LocalPlayer local spawn = workspace:FindFirstChildWhichIsA("SpawnLocation", true) if me.Character and me.Character:FindFirstChild("HumanoidRootPart") and spawn then me.Character.HumanoidRootPart.CFrame = spawn.CFrame + Vector3.new(0, 4, 0) print("Teleported to spawn") end]] else return [[ local Players = game:GetService("Players") local lp = Players.LocalPlayer local sg = Instance.new("ScreenGui") sg.Name = "QuickMenuGui" sg.ResetOnSpawn = false sg.Parent = lp:WaitForChild("PlayerGui") local f = Instance.new("Frame") f.Size = UDim2.fromOffset(200, 110) f.Position = UDim2.new(0.5, -100, 0.5, -55) f.BackgroundColor3 = Color3.fromRGB(16, 16, 22) f.BorderSizePixel = 0 f.Parent = sg Instance.new("UICorner", f).CornerRadius = UDim.new(0, 10) local b = Instance.new("TextButton") b.Size = UDim2.new(1, -20, 0, 32) b.Position = UDim2.fromOffset(10, 38) b.BackgroundColor3 = Color3.fromRGB(170, 70, 255) b.TextColor3 = Color3.new(1, 1, 1) b.Text = "Boost Speed" b.Font = Enum.Font.GothamBold b.TextSize = 12 b.Parent = f Instance.new("UICorner", b).CornerRadius = UDim.new(0, 8) b.MouseButton1Click:Connect(function() local hum = lp.Character and lp.Character:FindFirstChildOfClass("Humanoid") if hum then hum.WalkSpeed = 45 end end) print("QuickMenuGui ready")]] end end local function buildFixedScript(promptText: string, numVal: number?): (string, string) local topicToUse = (lastTopic ~= "general") and lastTopic or detectTopic(promptText) local rawSource = (editorBox and editorBox.Text:match("%S") and editorBox.Text) or (lastGeneratedScript ~= "" and lastGeneratedScript) or createScriptByTopic(topicToUse, promptText, numVal) if rawSource:find("%-%- Smart starter script for:", 1, false) then rawSource = createScriptByTopic(topicToUse ~= "general" and topicToUse or "gui", promptText, numVal) end local fixesApplied = {} local code = rawSource if not code:find("game:GetService", 1, true) and code:find("Players", 1, true) then code = 'local Players = game:GetService("Players")\n' .. code table.insert(fixesApplied, "added Players service lookup") end if code:find("Humanoid", 1, true) and not code:find("FindFirstChildOfClass(\"Humanoid\")", 1, true) and not code:find("WaitForChild(\"Humanoid\"", 1, true) then code = code:gsub("char%.Humanoid", 'char:FindFirstChildOfClass("Humanoid")') table.insert(fixesApplied, "safer Humanoid lookup") end if numVal then code = code:gsub("speed%s*=%s*%d+", "speed = " .. numVal) code = code:gsub("targetSpeed%s*=%s*%d+", "targetSpeed = " .. numVal) code = code:gsub("targetJump%s*=%s*%d+", "targetJump = " .. numVal) lastNumber = numVal table.insert(fixesApplied, "updated value to " .. numVal) end code = "-- Fixed by ScriptBot v3\n" .. code:gsub("^%-%-[^\n]*\n", "") local summary = #fixesApplied > 0 and ("Okay, here's a real script instead of that placeholder! I " .. table.concat(fixesApplied, ", ") .. ".") or "Okay, here's an upgraded script with proper UI/service setup instead of that placeholder." return summary, code end local function respondWithScriptBot(promptText: string): (string, string?) local lower = promptText:lower() local numVal = tonumber(lower:match("(%d+)")) if numVal then lastNumber = numVal end local detected = detectTopic(promptText) if detected ~= "general" then lastTopic = detected end if lower:find("doesn't work", 1, true) or lower:find("doesnt work", 1, true) or lower:find("not working", 1, true) or lower:find("broken", 1, true) or lower:find("fix", 1, true) or lower:find("error", 1, true) or lower:find("bug", 1, true) then local fixMsg, fixedCode = buildFixedScript(promptText, numVal) return fixMsg, fixedCode end local isFollowUpTweak = (lower:find("make it", 1, true) or lower:find("change ", 1, true) or lower:find("set it", 1, true) or lower:find("more ", 1, true)) and lastTopic ~= "general" local asksForScript = isFollowUpTweak or detected ~= "general" or lower:find("generate", 1, true) or lower:find("make ", 1, true) or lower:find("create ", 1, true) or lower:find("write ", 1, true) or lower:find("script", 1, true) if asksForScript then local topicToUse = (detected ~= "general") and detected or lastTopic local code = createScriptByTopic(topicToUse, promptText, numVal) return "Bet, here's a real script for \"" .. promptText .. "\" (" .. topicToUse .. "). Hit Load to Editor or Run Now!", code end if lower:find("hi", 1, true) or lower:find("hello", 1, true) or lower:find("yo", 1, true) or lower:find("sup", 1, true) then return "Yo! Welcome to ScriptBot v3. Ask me for a GUI, player lookup GUI, fly, speed, jump, esp, xray, noclip, invis, anti-afk, or tp!", nil elseif lower:find("who are you", 1, true) or lower:find("what can you do", 1, true) then return "I'm ScriptBot v3 inside Lunar X! I build real ScreenGuis and Luau scripts, tweak numbers, and replace broken/placeholder code.", nil elseif lower:find("thanks", 1, true) or lower:find("thx", 1, true) or lower:find("goat", 1, true) then return "Anytime broski! Want me to tweak your last " .. lastTopic .. " script or build another one?", nil else return "Gotcha! Try asking for a 'gui', 'username lookup gui', 'fly 80', 'speed 60', or 'fix this'.", nil end end local inputRow = Instance.new("Frame") inputRow.Position = UDim2.new(0, 10, 1, -42) inputRow.Size = UDim2.new(1, -20, 0, 34) inputRow.BackgroundTransparency = 1 inputRow.Parent = page local chatInput = Instance.new("TextBox") chatInput.Size = UDim2.new(1, -86, 1, 0) chatInput.BackgroundColor3 = BLACK chatInput.TextColor3 = Color3.new(1, 1, 1) chatInput.PlaceholderText = "Ask for a GUI, username GUI, speed, fly, or 'fix this'..." chatInput.Font = Enum.Font.GothamMedium chatInput.TextSize = 12 chatInput.ClearTextOnFocus = false chatInput.Text = "" chatInput.Parent = inputRow corner(chatInput, UDim.new(0, 8)) local sendBtn = Instance.new("TextButton") sendBtn.Size = UDim2.fromOffset(78, 34) sendBtn.Position = UDim2.new(1, -78, 0, 0) sendBtn.BackgroundColor3 = ACCENT sendBtn.Text = "Send" sendBtn.Font = Enum.Font.GothamBold sendBtn.TextSize = 13 sendBtn.TextColor3 = Color3.new(1, 1, 1) sendBtn.Parent = inputRow corner(sendBtn, UDim.new(0, 8)) registerAccent(sendBtn, "BackgroundColor3") local function sendPrompt() local raw = chatInput.Text:match("^%s*(.-)%s*$") if raw == "" then return end chatInput.Text = "" addChatMessage("You", raw, nil) local replyText, code = respondWithScriptBot(raw) addChatMessage("Bot", replyText, code) end sendBtn.MouseButton1Click:Connect(sendPrompt) chatInput.FocusLost:Connect(function(enterPressed) if enterPressed then sendPrompt() end end) addChatMessage("Bot", "Welcome to ScriptBot v3", nil) end ---------------------------------------------------------------- TAB 6: DEVELOPERS do local page = pages["Developers"] local h = Instance.new("TextLabel") h.Size = UDim2.new(1, 0, 0, 40) h.Position = UDim2.fromOffset(0, 16) h.BackgroundTransparency = 1 h.Text = "Developers" h.Font = Enum.Font.GothamBold h.TextSize = 22 h.TextColor3 = ACCENT h.Parent = page registerAccent(h, "TextColor3") local names = { "Wackyhax", "lunaroutmoon", "Sp1ir" } for i, n in ipairs(names) do local l = Instance.new("TextLabel") l.Size = UDim2.new(1, -40, 0, 40) l.Position = UDim2.new(0, 20, 0, 60 + (i - 1) * 48) l.BackgroundColor3 = BLACK l.Text = n l.Font = Enum.Font.GothamMedium l.TextSize = 18 l.TextColor3 = Color3.new(1, 1, 1) l.Parent = page corner(l, UDim.new(0, 10)) end end ---------------------------------------------------------------- LOGO BUTTON (customizable shape & size) local logo = Instance.new("TextButton") logo.Name = "Logo" logo.Size = UDim2.fromOffset(40, 40) logo.Position = UDim2.new(0, 20, 0.5, -20) logo.BackgroundColor3 = BLACK logo.Text = "🌙" logo.TextSize = 20 logo.AutoButtonColor = false logo.Visible = false logo.Parent = gui local logoCorner = corner(logo, UDim.new(0, 12)) local logoStroke = Instance.new("UIStroke") logoStroke.Color = ACCENT logoStroke.Thickness = 2 logoStroke.Parent = logo registerAccent(logoStroke, "Color") local currentShape = "Squircle" local currentSize = "Small" local shapePresets = { Squircle = UDim.new(0, 12), Circle = UDim.new(1, 0), Sharp = UDim.new(0, 2), } local sizePresets = { Small = { px = 40, text = 20 }, Medium = { px = 54, text = 26 }, Large = { px = 68, text = 32 }, } local function applyLogoStyle(shapeName: string?, sizeName: string?) if shapeName and shapePresets[shapeName] then currentShape = shapeName logoCorner.CornerRadius = shapePresets[shapeName] end if sizeName and sizePresets[sizeName] then currentSize = sizeName local preset = sizePresets[sizeName] logo.Size = UDim2.fromOffset(preset.px, preset.px) logo.TextSize = preset.text end end ---------------------------------------------------------------- TAB 7: SETTINGS do local page = pages["Settings"] local scroll = Instance.new("ScrollingFrame") scroll.Size = UDim2.new(1, 0, 1, 0) scroll.BackgroundTransparency = 1 scroll.BorderSizePixel = 0 scroll.ScrollBarThickness = 5 scroll.CanvasSize = UDim2.fromOffset(0, 0) scroll.Parent = page local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 8) layout.Parent = scroll local pad = Instance.new("UIPadding") pad.PaddingTop = UDim.new(0, 10) pad.PaddingBottom = UDim.new(0, 12) pad.PaddingLeft = UDim.new(0, 10) pad.PaddingRight = UDim.new(0, 10) pad.Parent = scroll layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() scroll.CanvasSize = UDim2.fromOffset(0, layout.AbsoluteContentSize.Y + 20) end) local function sectionLabel(text) local lbl = Instance.new("TextLabel") lbl.Size = UDim2.new(1, 0, 0, 20) lbl.BackgroundTransparency = 1 lbl.Text = text lbl.Font = Enum.Font.GothamBold lbl.TextSize = 13 lbl.TextColor3 = ACCENT lbl.TextXAlignment = Enum.TextXAlignment.Left lbl.Parent = scroll registerAccent(lbl, "TextColor3") return lbl end local function applyAccentColor(newColor: Color3) ACCENT = newColor for _, entry in ipairs(accentTargets) do if entry.obj and entry.obj.Parent then entry.obj[entry.prop] = ACCENT end end refreshTabHighlights() end local function parseCustomColor(raw: string): Color3? local trimmed = raw:match("^%s*(.-)%s*$") if trimmed == "" then return nil end local hex = trimmed:match("^#?(%x%x%x%x%x%x)$") if hex then local r = tonumber(hex:sub(1, 2), 16) local g = tonumber(hex:sub(3, 4), 16) local b = tonumber(hex:sub(5, 6), 16) if r and g and b then return Color3.fromRGB(r, g, b) end end local rStr, gStr, bStr = trimmed:match("^(%d+)%s*[,%s]%s*(%d+)%s*[,%s]%s*(%d+)$") if rStr and gStr and bStr then local r = math.clamp(tonumber(rStr) or 0, 0, 255) local g = math.clamp(tonumber(gStr) or 0, 0, 255) local b = math.clamp(tonumber(bStr) or 0, 0, 255) return Color3.fromRGB(r, g, b) end return nil end sectionLabel("UI Themes") local themePresets = { { name = "Purple", color = Color3.fromRGB(170, 70, 255) }, { name = "Cyan", color = Color3.fromRGB(0, 200, 255) }, { name = "Emerald", color = Color3.fromRGB(45, 215, 130) }, { name = "Rose", color = Color3.fromRGB(255, 75, 145) }, } local themeRow = Instance.new("Frame") themeRow.Size = UDim2.new(1, 0, 0, 32) themeRow.BackgroundTransparency = 1 themeRow.Parent = scroll local themeLayout = Instance.new("UIListLayout") themeLayout.FillDirection = Enum.FillDirection.Horizontal themeLayout.Padding = UDim.new(0, 6) themeLayout.Parent = themeRow for _, t in ipairs(themePresets) do local tb = Instance.new("TextButton") tb.Size = UDim2.new(0.25, -5, 1, 0) tb.BackgroundColor3 = BLACK tb.Text = t.name tb.Font = Enum.Font.GothamBold tb.TextSize = 12 tb.TextColor3 = Color3.new(1, 1, 1) tb.Parent = themeRow corner(tb, UDim.new(0, 8)) tb.MouseButton1Click:Connect(function() applyAccentColor(t.color) end) end local customRow = Instance.new("Frame") customRow.Size = UDim2.new(1, 0, 0, 32) customRow.BackgroundTransparency = 1 customRow.Parent = scroll local customColorBox = Instance.new("TextBox") customColorBox.Size = UDim2.new(1, -92, 1, 0) customColorBox.BackgroundColor3 = BLACK customColorBox.TextColor3 = Color3.new(1, 1, 1) customColorBox.PlaceholderText = "Custom color (e.g. #ff5500 or 255, 85, 0)..." customColorBox.Font = Enum.Font.GothamMedium customColorBox.TextSize = 12 customColorBox.ClearTextOnFocus = false customColorBox.Text = "" customColorBox.Parent = customRow corner(customColorBox, UDim.new(0, 8)) local applyCustomBtn = Instance.new("TextButton") applyCustomBtn.Size = UDim2.fromOffset(84, 32) applyCustomBtn.Position = UDim2.new(1, -84, 0, 0) applyCustomBtn.BackgroundColor3 = ACCENT applyCustomBtn.Text = "Set Color" applyCustomBtn.Font = Enum.Font.GothamBold applyCustomBtn.TextSize = 12 applyCustomBtn.TextColor3 = Color3.new(1, 1, 1) applyCustomBtn.Parent = customRow corner(applyCustomBtn, UDim.new(0, 8)) registerAccent(applyCustomBtn, "BackgroundColor3") applyCustomBtn.MouseButton1Click:Connect(function() local parsed = parseCustomColor(customColorBox.Text) if parsed then applyAccentColor(parsed) else customColorBox.Text = "" customColorBox.PlaceholderText = "Invalid! Use #RRGGBB or R, G, B" end end) local function optionRow(options, onPick, getActive) local row = Instance.new("Frame") row.Size = UDim2.new(1, 0, 0, 32) row.BackgroundTransparency = 1 row.Parent = scroll local list = Instance.new("UIListLayout") list.FillDirection = Enum.FillDirection.Horizontal list.Padding = UDim.new(0, 6) list.Parent = row local btns = {} local function refresh() local active = getActive() for name, btn in pairs(btns) do tween(btn, 0.15, { BackgroundColor3 = (name == active) and ACCENT or BLACK, TextColor3 = (name == active) and Color3.new(1, 1, 1) or MUTED, }) end end for _, opt in ipairs(options) do local b = Instance.new("TextButton") b.Size = UDim2.new(1 / #options, -4, 1, 0) b.BackgroundColor3 = BLACK b.Text = opt b.Font = Enum.Font.GothamMedium b.TextSize = 12 b.TextColor3 = MUTED b.Parent = row corner(b, UDim.new(0, 8)) btns[opt] = b b.MouseButton1Click:Connect(function() onPick(opt) refresh() end) end refresh() end sectionLabel("Logo Shape") optionRow({ "Squircle", "Circle", "Sharp" }, function(picked) applyLogoStyle(picked, nil) end, function() return currentShape end) sectionLabel("Logo Size") optionRow({ "Small", "Medium", "Large" }, function(picked) applyLogoStyle(nil, picked) end, function() return currentSize end) local consoleBtn = Instance.new("TextButton") consoleBtn.Size = UDim2.new(1, 0, 0, 34) consoleBtn.BackgroundColor3 = BLACK consoleBtn.Text = "🖥️ Console" consoleBtn.Font = Enum.Font.GothamBold consoleBtn.TextSize = 13 consoleBtn.TextColor3 = Color3.new(1, 1, 1) consoleBtn.Parent = scroll corner(consoleBtn, UDim.new(0, 8)) consoleBtn.MouseButton1Click:Connect(function() consoleWin.Visible = not consoleWin.Visible end) local soonLbl = Instance.new("TextLabel") soonLbl.Size = UDim2.new(1, 0, 0, 24) soonLbl.BackgroundTransparency = 1 soonLbl.Text = "More coming soon!" soonLbl.Font = Enum.Font.GothamBold soonLbl.TextSize = 13 soonLbl.TextColor3 = MUTED soonLbl.TextXAlignment = Enum.TextXAlignment.Center soonLbl.Parent = scroll end selectTab("Editor") -- drag window by title bar do local dragging, startPos, startInput titleBar.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, startPos, startInput = true, main.Position, i.Position end end) UserInputService.InputChanged:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - startInput main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end) UserInputService.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end) end local guiOpen = false local function openGui() guiOpen = true main.Visible = true main.Size = UDim2.fromOffset(0, 0) title.TextTransparency = 1 tween(main, 0.5, { Size = FULL }, Enum.EasingStyle.Back, Enum.EasingDirection.Out) task.delay(0.25, function() tween(title, 0.4, { TextTransparency = 0 }) end) end local function closeGui() guiOpen = false consoleWin.Visible = false local tw = tween(main, 0.35, { Size = UDim2.fromOffset(0, 0) }, Enum.EasingStyle.Back, Enum.EasingDirection.In) tw.Completed:Connect(function() if not guiOpen then main.Visible = false end end) end closeBtn.MouseButton1Click:Connect(closeGui) do local dragging, moved, startPos, startInput = false, false, nil, nil logo.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, moved, startPos, startInput = true, false, logo.Position, i.Position end end) UserInputService.InputChanged:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - startInput if d.Magnitude > 6 then moved = true end if moved then logo.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end end) UserInputService.InputEnded:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch) then dragging = false if not moved then if guiOpen then closeGui() else openGui() end end end end) end ---------------------------------------------------------------- INTRO ANIMATION local bar = Instance.new("Frame") bar.AnchorPoint = Vector2.new(0.5, 0) bar.Position = UDim2.new(0.5, 0, 0, -80) bar.Size = UDim2.new(0.7, 0, 0, 60) bar.BackgroundColor3 = BLACK bar.BorderSizePixel = 0 bar.Parent = gui corner(bar, UDim.new(0, 10)) local barStroke = Instance.new("UIStroke") barStroke.Color = ACCENT barStroke.Thickness = 1.5 barStroke.Parent = bar registerAccent(barStroke, "Color") local barText = Instance.new("TextLabel") barText.Size = UDim2.fromScale(1, 1) barText.BackgroundTransparency = 1 barText.Text = "Thank you for using lunar x!" barText.Font = Enum.Font.GothamBold barText.TextSize = 22 barText.TextColor3 = Color3.new(1, 1, 1) barText.Parent = bar tween(bar, 0.6, { Position = UDim2.new(0.5, 0, 0, 30) }, Enum.EasingStyle.Back) task.wait(3.6) tween(barText, 0.4, { TextTransparency = 1 }) tween(barStroke, 0.7, { Transparency = 1 }) local suck = tween(bar, 0.7, { Size = UDim2.fromOffset(0, 0), Position = UDim2.new(0.5, 0, 0.5, 0), BackgroundTransparency = 1, }, Enum.EasingStyle.Back, Enum.EasingDirection.In) suck.Completed:Wait() bar:Destroy() logo.Visible = true openGui()