-- ========================================== -- ORLYXIS HUB PIXEL EDITION - GUI LIBRARY (CLEAN & ROBUST) -- ========================================== -- Fixes & Improvements: -- 1. Fixed drag system with proper input validation -- 2. Auto-close dropdown when clicking outside -- 3. Keybind system ignores TextBox focus -- 4. Proper cleanup on unload (no memory leaks) -- 5. Color picker popup auto-destroys with parent -- 6. Debounced tweens to prevent spam issues -- 7. Duplicate ScreenGui detection -- 8. Safe avatar loading with fallback -- 9. Particle system with FPS limiter -- 10. Modular component design -- 11. Fixed minimize/close state conflicts -- 12. Better error handling throughout -- ========================================== local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") -- ========================================== -- LIBRARY CONTAINER -- ========================================== local OrlyxisHub = {} OrlyxisHub.__index = OrlyxisHub -- ========================================== -- DETEKSI EXECUTOR -- ========================================== local function detectExecutor() if syn then return "Synapse X" end if getexecutorname then local ok, name = pcall(getexecutorname) if ok and name then return name end end if KRNL_LOADED then return "KRNL" end if is_sirhurt_closure then return "SirHurt" end if identifyexecutor then local ok, name = pcall(identifyexecutor) if ok and name then return name end end if gethui then return "Custom" end return "Unknown" end local currentExecutor = detectExecutor() -- ========================================== -- TEMA PIXEL -- ========================================== local Theme = { BG = Color3.fromRGB(12, 12, 16), BGSecondary = Color3.fromRGB(20, 20, 28), Accent = Color3.fromRGB(0, 255, 136), Accent2 = Color3.fromRGB(255, 0, 85), Accent3 = Color3.fromRGB(0, 170, 255), Text = Color3.fromRGB(240, 240, 240), TextDim = Color3.fromRGB(140, 140, 160), Border = Color3.fromRGB(40, 40, 55), BorderActive = Color3.fromRGB(0, 255, 136), ToggleOn = Color3.fromRGB(0, 255, 136), ToggleOff = Color3.fromRGB(50, 50, 65), Success = Color3.fromRGB(0, 255, 100), Danger = Color3.fromRGB(255, 50, 50), Warning = Color3.fromRGB(255, 200, 0), } -- ========================================== -- CONSTANTS -- ========================================== local WIN_W = 400 local WIN_H = 260 local SIDEBAR_W = 110 local MIN_SIZE = UDim2.new(0, 32, 0, 32) local FULL_SIZE = UDim2.new(0, WIN_W, 0, WIN_H) -- ========================================== -- UTILITY FUNCTIONS -- ========================================== local function safeTween(object, properties, info) if not object or not object.Parent then return end local ok, err = pcall(function() TweenService:Create(object, info or TweenInfo.new(0.2), properties):Play() end) if not ok and err then warn("Tween Error:", err) end end local function disconnectTable(t) if type(t) ~= "table" then return end for _, v in ipairs(t) do if typeof(v) == "RBXScriptConnection" then pcall(function() v:Disconnect() end) elseif typeof(v) == "Instance" then pcall(function() v:Destroy() end) end end table.clear(t) end -- ========================================== -- MAIN CONSTRUCTOR -- ========================================== function OrlyxisHub.new(options) options = options or {} local self = setmetatable({}, OrlyxisHub) -- Cleanup tracking self._connections = {} self._tweens = {} self._particles = {} self._components = {} self._dropdowns = {} self._popups = {} self._keybinds = {} self._isDestroyed = false self._isMinimized = false self._dragging = false self._activeTab = nil self._tabs = {} -- Destroy existing GUI local existing = playerGui:FindFirstChild("OrlyxisPixelHubV2") if existing then existing:Destroy() end -- ScreenGui self.screenGui = Instance.new("ScreenGui") self.screenGui.Name = "OrlyxisPixelHubV2" self.screenGui.ResetOnSpawn = false self.screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling self.screenGui.Parent = playerGui -- Main Window self.mainWindow = Instance.new("Frame") self.mainWindow.Name = "MainWindow" self.mainWindow.Size = FULL_SIZE self.mainWindow.Position = UDim2.new(0.5, -WIN_W/2, 0.5, -WIN_H/2) self.mainWindow.BackgroundColor3 = Theme.BG self.mainWindow.BorderSizePixel = 0 self.mainWindow.ClipsDescendants = true self.mainWindow.ZIndex = 10 self.mainWindow.Parent = self.screenGui -- Window Border self.winBorder = Instance.new("UIStroke") self.winBorder.Color = Theme.Border self.winBorder.Thickness = 2 self.winBorder.ApplyStrokeMode = Enum.ApplyStrokeMode.Border self.winBorder.Parent = self.mainWindow -- Shadow local winShadow = Instance.new("ImageLabel") winShadow.Size = UDim2.new(1, 40, 1, 40) winShadow.Position = UDim2.new(0, -20, 0, -15) winShadow.BackgroundTransparency = 1 winShadow.Image = "rbxassetid://6015897733" winShadow.ImageColor3 = Color3.fromRGB(0,0,0) winShadow.ImageTransparency = 0.5 winShadow.ZIndex = 9 winShadow.Parent = self.mainWindow -- Build UI self:_buildSidebar() self:_buildTopBar() self:_buildContentArea() self:_buildVFX() self:_buildDragSystem() self:_buildMinimizeSystem() self:_buildCloseSystem() self:_buildGlobalInput() -- Intro Animation self:_playIntro() return self end -- ========================================== -- VFX SYSTEM (FPS-LIMITED) -- ========================================== function OrlyxisHub:_buildVFX() -- Grid Background local gridBg = Instance.new("ImageLabel") gridBg.Size = UDim2.new(1, 0, 1, 0) gridBg.BackgroundTransparency = 1 gridBg.Image = "rbxassetid://12977670818" gridBg.ImageColor3 = Theme.Accent gridBg.ImageTransparency = 0.97 gridBg.ZIndex = 11 gridBg.Parent = self.mainWindow local gridOffset = 0 local gridConn = RunService.RenderStepped:Connect(function(dt) if self._isDestroyed then return end gridOffset = (gridOffset + dt * 8) % 32 gridBg.Position = UDim2.new(0, -gridOffset, 0, -gridOffset) end) table.insert(self._connections, gridConn) -- Scanline local scanline = Instance.new("Frame") scanline.Size = UDim2.new(1, 0, 0, 2) scanline.Position = UDim2.new(0, 0, 0, -10) scanline.BackgroundColor3 = Theme.Accent scanline.BackgroundTransparency = 0.85 scanline.BorderSizePixel = 0 scanline.ZIndex = 100 scanline.Parent = self.mainWindow local scanlinePos = -10 local scanConn = RunService.RenderStepped:Connect(function(dt) if self._isDestroyed then return end scanlinePos = scanlinePos + dt * 120 if scanlinePos > WIN_H then scanlinePos = -10 end scanline.Position = UDim2.new(0, 0, 0, scanlinePos) end) table.insert(self._connections, scanConn) -- Glow Pulse local glowPulse = Instance.new("Frame") glowPulse.Size = UDim2.new(1, 4, 1, 4) glowPulse.Position = UDim2.new(0, -2, 0, -2) glowPulse.BackgroundTransparency = 1 glowPulse.BorderSizePixel = 0 glowPulse.ZIndex = 8 glowPulse.Parent = self.mainWindow local glowStroke = Instance.new("UIStroke") glowStroke.Color = Theme.Accent glowStroke.Thickness = 2 glowStroke.Transparency = 0.9 glowStroke.Parent = glowPulse local pulseDir = 1 local pulseVal = 0.9 local pulseConn = RunService.RenderStepped:Connect(function(dt) if self._isDestroyed then return end pulseVal = pulseVal + dt * pulseDir * 0.5 if pulseVal > 0.95 then pulseDir = -1 end if pulseVal < 0.7 then pulseDir = 1 end glowStroke.Transparency = pulseVal end) table.insert(self._connections, pulseConn) -- Particles (Limited to 8 for performance) for i = 1, 8 do local p = Instance.new("Frame") p.Size = UDim2.new(0, math.random(2,4), 0, math.random(2,4)) p.Position = UDim2.new(0, math.random(0, WIN_W), 0, math.random(0, WIN_H)) p.BackgroundColor3 = Theme.Accent p.BackgroundTransparency = math.random(3, 8) / 10 p.BorderSizePixel = 0 p.ZIndex = 12 p.Parent = self.mainWindow local particle = { frame = p, speedX = (math.random() - 0.5) * 20, speedY = (math.random() - 0.5) * 20, baseX = p.Position.X.Offset, baseY = p.Position.Y.Offset, } table.insert(self._particles, particle) end local particleConn = RunService.RenderStepped:Connect(function(dt) if self._isDestroyed then return end for _, p in ipairs(self._particles) do if p.frame and p.frame.Parent then p.baseX = p.baseX + p.speedX * dt p.baseY = p.baseY + p.speedY * dt if p.baseX < 0 or p.baseX > WIN_W then p.speedX = -p.speedX end if p.baseY < 0 or p.baseY > WIN_H then p.speedY = -p.speedY end p.frame.Position = UDim2.new(0, p.baseX, 0, p.baseY) end end end) table.insert(self._connections, particleConn) end -- ========================================== -- SIDEBAR -- ========================================== function OrlyxisHub:_buildSidebar() self.sidebar = Instance.new("Frame") self.sidebar.Name = "Sidebar" self.sidebar.Size = UDim2.new(0, SIDEBAR_W, 1, 0) self.sidebar.Position = UDim2.new(0, 0, 0, 0) self.sidebar.BackgroundColor3 = Theme.BGSecondary self.sidebar.BorderSizePixel = 0 self.sidebar.ZIndex = 11 self.sidebar.Parent = self.mainWindow local sideBorder = Instance.new("Frame") sideBorder.Size = UDim2.new(0, 2, 1, 0) sideBorder.Position = UDim2.new(1, -2, 0, 0) sideBorder.BackgroundColor3 = Theme.Border sideBorder.BorderSizePixel = 0 sideBorder.ZIndex = 12 sideBorder.Parent = self.sidebar -- Avatar local avatarContainer = Instance.new("Frame") avatarContainer.Name = "AvatarContainer" avatarContainer.Size = UDim2.new(0, 52, 0, 52) avatarContainer.Position = UDim2.new(0.5, -26, 0, 10) avatarContainer.BackgroundColor3 = Theme.BG avatarContainer.BorderSizePixel = 0 avatarContainer.ZIndex = 13 avatarContainer.Parent = self.sidebar local avBorder = Instance.new("UIStroke") avBorder.Color = Theme.Accent avBorder.Thickness = 2 avBorder.Parent = avatarContainer local avatarImage = Instance.new("ImageLabel") avatarImage.Name = "AvatarImage" avatarImage.Size = UDim2.new(1, -4, 1, -4) avatarImage.Position = UDim2.new(0, 2, 0, 2) avatarImage.BackgroundTransparency = 1 avatarImage.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. player.UserId .. "&width=420&height=420&format=png" avatarImage.ZIndex = 14 avatarImage.Parent = avatarContainer -- Fallback for avatar avatarImage.Loaded:Connect(function(success) if not success then avatarImage.Image = "rbxassetid://0" avatarImage.BackgroundColor3 = Theme.Accent end end) -- Status Dot local statusDot = Instance.new("Frame") statusDot.Size = UDim2.new(0, 8, 0, 8) statusDot.Position = UDim2.new(1, -6, 1, -6) statusDot.BackgroundColor3 = Theme.Success statusDot.BorderSizePixel = 0 statusDot.ZIndex = 15 statusDot.Parent = avatarContainer task.spawn(function() while statusDot and statusDot.Parent do safeTween(statusDot, {BackgroundTransparency = 0.3}, TweenInfo.new(0.8)) task.wait(0.8) if not (statusDot and statusDot.Parent) then break end safeTween(statusDot, {BackgroundTransparency = 0}, TweenInfo.new(0.8)) task.wait(0.8) end end) -- Name Labels local nameLabel = Instance.new("TextLabel") nameLabel.Size = UDim2.new(1, -4, 0, 16) nameLabel.Position = UDim2.new(0, 2, 0, 64) nameLabel.BackgroundTransparency = 1 nameLabel.Text = player.Name nameLabel.TextColor3 = Theme.Text nameLabel.Font = Enum.Font.Code nameLabel.TextSize = 11 nameLabel.TextXAlignment = Enum.TextXAlignment.Center nameLabel.ZIndex = 13 nameLabel.Parent = self.sidebar if player.DisplayName ~= player.Name then local dispLabel = Instance.new("TextLabel") dispLabel.Size = UDim2.new(1, -4, 0, 12) dispLabel.Position = UDim2.new(0, 2, 0, 80) dispLabel.BackgroundTransparency = 1 dispLabel.Text = "@" .. player.DisplayName dispLabel.TextColor3 = Theme.TextDim dispLabel.Font = Enum.Font.Code dispLabel.TextSize = 9 dispLabel.TextXAlignment = Enum.TextXAlignment.Center dispLabel.ZIndex = 13 dispLabel.Parent = self.sidebar end -- Executor Badge local execBadge = Instance.new("Frame") execBadge.Size = UDim2.new(0, 100, 0, 18) execBadge.Position = UDim2.new(0.5, -50, 0, 96) execBadge.BackgroundColor3 = Theme.BG execBadge.BorderSizePixel = 0 execBadge.ZIndex = 13 execBadge.Parent = self.sidebar local execBorder = Instance.new("UIStroke") execBorder.Color = Theme.Accent execBorder.Thickness = 1 execBorder.Parent = execBadge local execLabel = Instance.new("TextLabel") execLabel.Size = UDim2.new(1, 0, 1, 0) execLabel.BackgroundTransparency = 1 execLabel.Text = "> " .. currentExecutor execLabel.TextColor3 = Theme.Accent execLabel.Font = Enum.Font.Code execLabel.TextSize = 9 execLabel.TextXAlignment = Enum.TextXAlignment.Center execLabel.ZIndex = 14 execLabel.Parent = execBadge -- Tab List self.tabList = Instance.new("ScrollingFrame") self.tabList.Name = "TabList" self.tabList.Size = UDim2.new(1, -6, 1, -124) self.tabList.Position = UDim2.new(0, 3, 0, 120) self.tabList.BackgroundTransparency = 1 self.tabList.BorderSizePixel = 0 self.tabList.ScrollBarThickness = 2 self.tabList.ScrollBarImageColor3 = Theme.Accent self.tabList.ZIndex = 13 self.tabList.Parent = self.sidebar local tabLayout = Instance.new("UIListLayout") tabLayout.Padding = UDim.new(0, 3) tabLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center tabLayout.SortOrder = Enum.SortOrder.LayoutOrder tabLayout.Parent = self.tabList end -- ========================================== -- TOPBAR -- ========================================== function OrlyxisHub:_buildTopBar() self.topBar = Instance.new("Frame") self.topBar.Name = "TopBar" self.topBar.Size = UDim2.new(1, -SIDEBAR_W, 0, 32) self.topBar.Position = UDim2.new(0, SIDEBAR_W, 0, 0) self.topBar.BackgroundTransparency = 1 self.topBar.ZIndex = 12 self.topBar.Parent = self.mainWindow local topLine = Instance.new("Frame") topLine.Size = UDim2.new(1, -12, 0, 1) topLine.Position = UDim2.new(0, 6, 1, -1) topLine.BackgroundColor3 = Theme.Border topLine.BorderSizePixel = 0 topLine.ZIndex = 12 topLine.Parent = self.topBar local hubTitle = Instance.new("TextLabel") hubTitle.Size = UDim2.new(0, 140, 1, 0) hubTitle.Position = UDim2.new(0, 10, 0, 0) hubTitle.BackgroundTransparency = 1 hubTitle.Text = "ORLYXIS HUB" hubTitle.TextColor3 = Theme.Text hubTitle.Font = Enum.Font.Code hubTitle.TextSize = 12 hubTitle.TextXAlignment = Enum.TextXAlignment.Left hubTitle.ZIndex = 13 hubTitle.Parent = self.topBar local hubTag = Instance.new("TextLabel") hubTag.Size = UDim2.new(0, 44, 0, 14) hubTag.Position = UDim2.new(0, 110, 0.5, -7) hubTag.BackgroundColor3 = Theme.Accent hubTag.Text = "PIXEL" hubTag.TextColor3 = Theme.BG hubTag.Font = Enum.Font.Code hubTag.TextSize = 8 hubTag.ZIndex = 13 hubTag.Parent = self.topBar -- Minimize Button self.minBtn = Instance.new("TextButton") self.minBtn.Name = "MinimizeBtn" self.minBtn.Size = UDim2.new(0, 20, 0, 20) self.minBtn.Position = UDim2.new(1, -48, 0.5, -10) self.minBtn.BackgroundColor3 = Theme.BGSecondary self.minBtn.Text = "−" self.minBtn.TextColor3 = Theme.TextDim self.minBtn.Font = Enum.Font.Code self.minBtn.TextSize = 14 self.minBtn.ZIndex = 13 self.minBtn.Parent = self.topBar local minBorder = Instance.new("UIStroke") minBorder.Color = Theme.Border minBorder.Thickness = 1 minBorder.Parent = self.minBtn -- Close Button self.closeBtn = Instance.new("TextButton") self.closeBtn.Name = "CloseBtn" self.closeBtn.Size = UDim2.new(0, 20, 0, 20) self.closeBtn.Position = UDim2.new(1, -26, 0.5, -10) self.closeBtn.BackgroundColor3 = Theme.BGSecondary self.closeBtn.Text = "×" self.closeBtn.TextColor3 = Theme.Danger self.closeBtn.Font = Enum.Font.Code self.closeBtn.TextSize = 14 self.closeBtn.ZIndex = 13 self.closeBtn.Parent = self.topBar local closeBorder = Instance.new("UIStroke") closeBorder.Color = Theme.Border closeBorder.Thickness = 1 closeBorder.Parent = self.closeBtn -- Hover effects self.minBtn.MouseEnter:Connect(function() safeTween(self.minBtn, {BackgroundColor3 = Theme.Border}, TweenInfo.new(0.15)) safeTween(minBorder, {Color = Theme.Accent}, TweenInfo.new(0.15)) end) self.minBtn.MouseLeave:Connect(function() safeTween(self.minBtn, {BackgroundColor3 = Theme.BGSecondary}, TweenInfo.new(0.15)) safeTween(minBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) self.closeBtn.MouseEnter:Connect(function() safeTween(self.closeBtn, {BackgroundColor3 = Color3.fromRGB(60, 20, 20)}, TweenInfo.new(0.15)) safeTween(closeBorder, {Color = Theme.Danger}, TweenInfo.new(0.15)) end) self.closeBtn.MouseLeave:Connect(function() safeTween(self.closeBtn, {BackgroundColor3 = Theme.BGSecondary}, TweenInfo.new(0.15)) safeTween(closeBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) end -- ========================================== -- CONTENT AREA -- ========================================== function OrlyxisHub:_buildContentArea() self.contentArea = Instance.new("Frame") self.contentArea.Name = "ContentArea" self.contentArea.Size = UDim2.new(1, -SIDEBAR_W, 1, -36) self.contentArea.Position = UDim2.new(0, SIDEBAR_W, 0, 36) self.contentArea.BackgroundTransparency = 1 self.contentArea.ZIndex = 11 self.contentArea.Parent = self.mainWindow end -- ========================================== -- DRAG SYSTEM (FIXED) -- ========================================== function OrlyxisHub:_buildDragSystem() local dragStart = nil local startPos = nil local inputBeganConn = self.topBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then self._dragging = true dragStart = input.Position startPos = self.mainWindow.Position local changedConn changedConn = input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then self._dragging = false if changedConn then changedConn:Disconnect() end end end) end end) table.insert(self._connections, inputBeganConn) local inputChangedConn = UserInputService.InputChanged:Connect(function(input) if self._dragging and self._isDestroyed then return end if self._dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - dragStart self.mainWindow.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) end end) table.insert(self._connections, inputChangedConn) end -- ========================================== -- MINIMIZE SYSTEM (FIXED) -- ========================================== function OrlyxisHub:_buildMinimizeSystem() self.restoreBtn = Instance.new("TextButton") self.restoreBtn.Name = "RestoreBtn" self.restoreBtn.Size = UDim2.new(1, 0, 1, 0) self.restoreBtn.BackgroundColor3 = Theme.BG self.restoreBtn.Text = "▲" self.restoreBtn.TextColor3 = Theme.Accent self.restoreBtn.Font = Enum.Font.Code self.restoreBtn.TextSize = 16 self.restoreBtn.ZIndex = 50 self.restoreBtn.Visible = false self.restoreBtn.Parent = self.mainWindow local restoreBorder = Instance.new("UIStroke") restoreBorder.Color = Theme.Accent restoreBorder.Thickness = 2 restoreBorder.Parent = self.restoreBtn self.restoreBtn.MouseEnter:Connect(function() safeTween(self.restoreBtn, {BackgroundColor3 = Theme.BGSecondary}, TweenInfo.new(0.15)) end) self.restoreBtn.MouseLeave:Connect(function() safeTween(self.restoreBtn, {BackgroundColor3 = Theme.BG}, TweenInfo.new(0.15)) end) self.minBtn.MouseButton1Click:Connect(function() if self._isDestroyed then return end self._isMinimized = not self._isMinimized if self._isMinimized then self.sidebar.Visible = false self.contentArea.Visible = false self.topBar.Visible = false self.winBorder.Thickness = 0 self.restoreBtn.Visible = true safeTween(self.mainWindow, { Size = MIN_SIZE, Position = UDim2.new(1, -42, 1, -42) }, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out)) else self:_restoreWindow() end end) self.restoreBtn.MouseButton1Click:Connect(function() if self._isDestroyed then return end self:_restoreWindow() end) end function OrlyxisHub:_restoreWindow() self._isMinimized = false self.restoreBtn.Visible = false self.topBar.Visible = true self.winBorder.Thickness = 2 safeTween(self.mainWindow, { Size = FULL_SIZE, Position = UDim2.new(0.5, -WIN_W/2, 0.5, -WIN_H/2) }, TweenInfo.new(0.35, Enum.EasingStyle.Back, Enum.EasingDirection.Out)) task.delay(0.2, function() if self._isDestroyed then return end self.sidebar.Visible = true self.contentArea.Visible = true end) end -- ========================================== -- CLOSE SYSTEM (FIXED) -- ========================================== function OrlyxisHub:_buildCloseSystem() self.closeBtn.MouseButton1Click:Connect(function() if self._isDestroyed then return end -- Shake effect for i = 1, 5 do if not self.mainWindow or not self.mainWindow.Parent then break end self.mainWindow.Position = UDim2.new( 0.5, -WIN_W/2 + math.random(-5,5), 0.5, -WIN_H/2 + math.random(-5,5) ) task.wait(0.03) end safeTween(self.mainWindow, {Size = UDim2.new(0,0,0,0)}, TweenInfo.new(0.25)) safeTween(self.mainWindow, {BackgroundTransparency = 1}, TweenInfo.new(0.25)) task.delay(0.3, function() if self._isDestroyed then return end self.mainWindow.Visible = false self:_createFloatingIcon() end) end) end function OrlyxisHub:_createFloatingIcon() if self._floatingIcon then self._floatingIcon:Destroy() self._floatingIcon = nil end disconnectTable(self._floatingVFX) self._floatingVFX = {} local icon = Instance.new("TextButton") icon.Name = "OrlyxisIcon" icon.Size = UDim2.new(0, 40, 0, 40) icon.Position = UDim2.new(1, -55, 1, -55) icon.BackgroundColor3 = Theme.BG icon.Text = "◆" icon.TextColor3 = Theme.Accent2 icon.Font = Enum.Font.Code icon.TextSize = 20 icon.ZIndex = 200 icon.Parent = self.screenGui self._floatingIcon = icon local iconStroke = Instance.new("UIStroke") iconStroke.Color = Theme.Accent2 iconStroke.Thickness = 2 iconStroke.Parent = icon local glow = Instance.new("Frame") glow.Size = UDim2.new(1, 8, 1, 8) glow.Position = UDim2.new(0, -4, 0, -4) glow.BackgroundColor3 = Theme.Accent2 glow.BackgroundTransparency = 0.9 glow.BorderSizePixel = 0 glow.ZIndex = 199 glow.Parent = icon local orbs = {} for i = 1, 6 do local orb = Instance.new("Frame") orb.Size = UDim2.new(0, 3, 0, 3) orb.BackgroundColor3 = Theme.Accent orb.BorderSizePixel = 0 orb.ZIndex = 201 orb.Parent = icon table.insert(orbs, orb) table.insert(self._floatingVFX, orb) end local bobTime = 0 local orbitTime = 0 local vfxConn = RunService.RenderStepped:Connect(function(dt) if self._isDestroyed or not icon or not icon.Parent then return end bobTime = bobTime + dt * 3 orbitTime = orbitTime + dt * 2 icon.Position = UDim2.new(1, -55, 1, -55 + math.sin(bobTime) * 6) local glowT = 0.85 + math.sin(bobTime * 2) * 0.1 glow.BackgroundTransparency = glowT iconStroke.Transparency = 0.3 + math.sin(bobTime * 3) * 0.2 for i, orb in ipairs(orbs) do if orb and orb.Parent then local angle = orbitTime + (i * math.pi / 3) local radius = 22 + math.sin(bobTime + i) * 4 local ox = math.cos(angle) * radius local oy = math.sin(angle) * radius orb.Position = UDim2.new(0.5, ox - 1.5, 0.5, oy - 1.5) orb.BackgroundTransparency = 0.2 + math.sin(bobTime + i * 0.5) * 0.3 end end end) table.insert(self._connections, vfxConn) table.insert(self._floatingVFX, vfxConn) -- Drag icon local iconDragging = false local iconDragStart = nil local iconStartPos = nil local iconInputBegan = icon.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then iconDragging = true iconDragStart = input.Position iconStartPos = icon.Position local changedConn changedConn = input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then iconDragging = false if changedConn then changedConn:Disconnect() end end end) end end) table.insert(self._floatingVFX, iconInputBegan) local iconInputChanged = UserInputService.InputChanged:Connect(function(input) if iconDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then local delta = input.Position - iconDragStart icon.Position = UDim2.new( iconStartPos.X.Scale, iconStartPos.X.Offset + delta.X, iconStartPos.Y.Scale, iconStartPos.Y.Offset + delta.Y ) end end) table.insert(self._floatingVFX, iconInputChanged) local iconClick = icon.MouseButton1Click:Connect(function() if self._isDestroyed then return end disconnectTable(self._floatingVFX) self._floatingVFX = {} if self._floatingIcon then self._floatingIcon:Destroy() self._floatingIcon = nil end self.mainWindow.Visible = true safeTween(self.mainWindow, { Size = FULL_SIZE, BackgroundTransparency = 0 }, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out)) self.sidebar.Visible = true self.contentArea.Visible = true self.topBar.Visible = true self.winBorder.Thickness = 2 self._isMinimized = false end) table.insert(self._floatingVFX, iconClick) end -- ========================================== -- GLOBAL INPUT (Dropdown auto-close, Keybinds) -- ========================================== function OrlyxisHub:_buildGlobalInput() -- Auto-close dropdowns when clicking outside local globalClick = UserInputService.InputBegan:Connect(function(input, gameProcessed) if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end if gameProcessed then return end local mousePos = UserInputService:GetMouseLocation() for _, dropdown in ipairs(self._dropdowns) do if dropdown and dropdown.isOpen and dropdown.frame and dropdown.frame.Parent then local absPos = dropdown.frame.AbsolutePosition local absSize = dropdown.frame.AbsoluteSize if mousePos.X < absPos.X or mousePos.X > absPos.X + absSize.X or mousePos.Y < absPos.Y or mousePos.Y > absPos.Y + absSize.Y then dropdown:Close() end end end -- Close color popups for _, popup in ipairs(self._popups) do if popup and popup.isOpen and popup.frame and popup.frame.Parent then local absPos = popup.frame.AbsolutePosition local absSize = popup.frame.AbsoluteSize if mousePos.X < absPos.X or mousePos.X > absPos.X + absSize.X or mousePos.Y < absPos.Y or mousePos.Y > absPos.Y + absSize.Y then popup:Close() end end end end) table.insert(self._connections, globalClick) -- Keybind system (ignores text input) local keybindConn = UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.UserInputType ~= Enum.UserInputType.Keyboard then return end -- Check if any textbox is focused local focused = UserInputService:GetFocusedTextBox() if focused then return end local keyName = input.KeyCode.Name for _, kb in ipairs(self._keybinds) do if kb and kb.key == keyName and kb.callback then pcall(kb.callback) end end end) table.insert(self._connections, keybindConn) end -- ========================================== -- TAB SYSTEM -- ========================================== function OrlyxisHub:AddTab(name, icon, order) if self._isDestroyed then return nil end order = order or #self._tabs + 1 local tabBtn = Instance.new("TextButton") tabBtn.Name = name .. "Tab" tabBtn.Size = UDim2.new(0, 100, 0, 26) tabBtn.BackgroundColor3 = Theme.BGSecondary tabBtn.Text = "" tabBtn.LayoutOrder = order tabBtn.ZIndex = 14 tabBtn.Parent = self.tabList local tabBorder = Instance.new("UIStroke") tabBorder.Color = Theme.Border tabBorder.Thickness = 1 tabBorder.Parent = tabBtn local tabIcon = Instance.new("TextLabel") tabIcon.Size = UDim2.new(0, 20, 1, 0) tabIcon.Position = UDim2.new(0, 6, 0, 0) tabIcon.BackgroundTransparency = 1 tabIcon.Text = icon or ">" tabIcon.TextColor3 = Theme.TextDim tabIcon.Font = Enum.Font.Code tabIcon.TextSize = 11 tabIcon.ZIndex = 15 tabIcon.Parent = tabBtn local tabName = Instance.new("TextLabel") tabName.Size = UDim2.new(1, -30, 1, 0) tabName.Position = UDim2.new(0, 24, 0, 0) tabName.BackgroundTransparency = 1 tabName.Text = name tabName.TextColor3 = Theme.TextDim tabName.Font = Enum.Font.Code tabName.TextSize = 10 tabName.TextXAlignment = Enum.TextXAlignment.Left tabName.ZIndex = 15 tabName.Parent = tabBtn local indicator = Instance.new("Frame") indicator.Size = UDim2.new(0, 3, 0, 0) indicator.Position = UDim2.new(0, 0, 0.5, 0) indicator.BackgroundColor3 = Theme.Accent indicator.BorderSizePixel = 0 indicator.Visible = false indicator.ZIndex = 15 indicator.Parent = tabBtn local tabContent = Instance.new("ScrollingFrame") tabContent.Name = name .. "Content" tabContent.Size = UDim2.new(1, 0, 1, 0) tabContent.Position = UDim2.new(0, 0, 0, 0) tabContent.BackgroundTransparency = 1 tabContent.BorderSizePixel = 0 tabContent.ScrollBarThickness = 3 tabContent.ScrollBarImageColor3 = Theme.Accent tabContent.Visible = false tabContent.ZIndex = 11 tabContent.Parent = self.contentArea local contentLayout = Instance.new("UIListLayout") contentLayout.Padding = UDim.new(0, 6) contentLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center contentLayout.SortOrder = Enum.SortOrder.LayoutOrder contentLayout.Parent = tabContent local contentPadding = Instance.new("UIPadding") contentPadding.PaddingTop = UDim.new(0, 6) contentPadding.PaddingBottom = UDim.new(0, 10) contentPadding.PaddingLeft = UDim.new(0, 6) contentPadding.PaddingRight = UDim.new(0, 6) contentPadding.Parent = tabContent local tabData = { button = tabBtn, content = tabContent, indicator = indicator, icon = tabIcon, label = tabName, border = tabBorder, name = name, } table.insert(self._tabs, tabData) -- Click handler local clickConn = tabBtn.MouseButton1Click:Connect(function() if self._isDestroyed then return end self:_switchTab(tabData) end) table.insert(self._connections, clickConn) -- Hover tabBtn.MouseEnter:Connect(function() if self._activeTab ~= tabData then safeTween(tabBtn, {BackgroundColor3 = Color3.fromRGB(30,30,40)}, TweenInfo.new(0.2)) end end) tabBtn.MouseLeave:Connect(function() if self._activeTab ~= tabData then safeTween(tabBtn, {BackgroundColor3 = Theme.BGSecondary}, TweenInfo.new(0.2)) end end) -- Auto-select first tab if #self._tabs == 1 then self:_switchTab(tabData) end return tabData end function OrlyxisHub:_switchTab(tabData) if self._activeTab then local at = self._activeTab at.content.Visible = false at.indicator.Visible = false at.button.BackgroundColor3 = Theme.BGSecondary at.icon.TextColor3 = Theme.TextDim at.label.TextColor3 = Theme.TextDim at.border.Color = Theme.Border end self._activeTab = tabData tabData.content.Visible = true tabData.indicator.Visible = true tabData.button.BackgroundColor3 = Theme.BG tabData.icon.TextColor3 = Theme.Accent tabData.label.TextColor3 = Theme.Text tabData.border.Color = Theme.Accent -- Animate indicator tabData.indicator.Size = UDim2.new(0, 3, 0, 0) tabData.indicator.Position = UDim2.new(0, 0, 0.5, 0) safeTween(tabData.indicator, { Size = UDim2.new(0, 3, 0.7, 0), Position = UDim2.new(0, 0, 0.15, 0) }, TweenInfo.new(0.4, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out)) -- Flash effect local flash = Instance.new("Frame") flash.Size = UDim2.new(1, 0, 1, 0) flash.BackgroundColor3 = Theme.Accent flash.BackgroundTransparency = 0.7 flash.BorderSizePixel = 0 flash.ZIndex = 16 flash.Parent = tabData.button safeTween(flash, {BackgroundTransparency = 1}, TweenInfo.new(0.3)) task.delay(0.3, function() if flash and flash.Parent then flash:Destroy() end end) end -- ========================================== -- COMPONENT: SECTION -- ========================================== function OrlyxisHub:AddSection(tab, title, order) if self._isDestroyed or not tab then return nil end order = order or 1 local section = Instance.new("Frame") section.Name = title .. "Section" section.Size = UDim2.new(1, 0, 0, 28) section.BackgroundColor3 = Theme.BGSecondary section.BorderSizePixel = 0 section.LayoutOrder = order section.ZIndex = 12 section.AutomaticSize = Enum.AutomaticSize.Y section.Parent = tab.content local secBorder = Instance.new("UIStroke") secBorder.Color = Theme.Border secBorder.Thickness = 1 secBorder.Parent = section local sectionTitle = Instance.new("TextLabel") sectionTitle.Size = UDim2.new(1, -10, 0, 20) sectionTitle.Position = UDim2.new(0, 5, 0, 3) sectionTitle.BackgroundTransparency = 1 sectionTitle.Text = "[ " .. title .. " ]" sectionTitle.TextColor3 = Theme.Accent sectionTitle.Font = Enum.Font.Code sectionTitle.TextSize = 10 sectionTitle.TextXAlignment = Enum.TextXAlignment.Left sectionTitle.ZIndex = 13 sectionTitle.Parent = section local sectionContent = Instance.new("Frame") sectionContent.Name = "Content" sectionContent.Size = UDim2.new(1, -10, 0, 0) sectionContent.Position = UDim2.new(0, 5, 0, 22) sectionContent.BackgroundTransparency = 1 sectionContent.BorderSizePixel = 0 sectionContent.ZIndex = 13 sectionContent.AutomaticSize = Enum.AutomaticSize.Y sectionContent.Parent = section local sectionLayout = Instance.new("UIListLayout") sectionLayout.Padding = UDim.new(0, 5) sectionLayout.SortOrder = Enum.SortOrder.LayoutOrder sectionLayout.Parent = sectionContent return sectionContent end -- ========================================== -- COMPONENT: BUTTON -- ========================================== function OrlyxisHub:AddButton(section, text, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, 0, 0, 26) btn.BackgroundColor3 = Theme.BG btn.Text = "" btn.LayoutOrder = order btn.ZIndex = 14 btn.Parent = section local btnBorder = Instance.new("UIStroke") btnBorder.Color = Theme.Border btnBorder.Thickness = 1 btnBorder.Parent = btn local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -14, 1, 0) label.Position = UDim2.new(0, 7, 0, 0) label.BackgroundTransparency = 1 label.Text = "> " .. text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = btn local arrow = Instance.new("TextLabel") arrow.Size = UDim2.new(0, 14, 1, 0) arrow.Position = UDim2.new(1, -18, 0, 0) arrow.BackgroundTransparency = 1 arrow.Text = ">>" arrow.TextColor3 = Theme.TextDim arrow.Font = Enum.Font.Code arrow.TextSize = 10 arrow.ZIndex = 15 arrow.Parent = btn btn.MouseEnter:Connect(function() safeTween(btn, {BackgroundColor3 = Color3.fromRGB(30,32,45)}, TweenInfo.new(0.15)) safeTween(btnBorder, {Color = Theme.Accent}, TweenInfo.new(0.15)) safeTween(arrow, {TextColor3 = Theme.Accent}, TweenInfo.new(0.2)) end) btn.MouseLeave:Connect(function() safeTween(btn, {BackgroundColor3 = Theme.BG}, TweenInfo.new(0.15)) safeTween(btnBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) safeTween(arrow, {TextColor3 = Theme.TextDim}, TweenInfo.new(0.2)) end) btn.MouseButton1Click:Connect(function() if self._isDestroyed then return end -- Ripple local ripple = Instance.new("Frame") ripple.Size = UDim2.new(0, 4, 0, 4) ripple.Position = UDim2.new(0, 7, 0.5, -2) ripple.BackgroundColor3 = Theme.Accent ripple.BorderSizePixel = 0 ripple.ZIndex = 16 ripple.Parent = btn safeTween(ripple, {Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1}, TweenInfo.new(0.3)) task.delay(0.3, function() if ripple and ripple.Parent then ripple:Destroy() end end) if callback then local ok, err = pcall(callback) if not ok then warn("Button callback error:", err) end end end) return btn end -- ========================================== -- COMPONENT: TOGGLE -- ========================================== function OrlyxisHub:AddToggle(section, text, defaultState, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 local toggleFrame = Instance.new("Frame") toggleFrame.Size = UDim2.new(1, 0, 0, 26) toggleFrame.BackgroundColor3 = Theme.BG toggleFrame.BorderSizePixel = 0 toggleFrame.LayoutOrder = order toggleFrame.ZIndex = 14 toggleFrame.Parent = section local togBorder = Instance.new("UIStroke") togBorder.Color = Theme.Border togBorder.Thickness = 1 togBorder.Parent = toggleFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -70, 1, 0) label.Position = UDim2.new(0, 7, 0, 0) label.BackgroundTransparency = 1 label.Text = (defaultState and "[✓] " or "[ ] ") .. text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = toggleFrame local toggleBox = Instance.new("Frame") toggleBox.Size = UDim2.new(0, 28, 0, 14) toggleBox.Position = UDim2.new(1, -40, 0.5, -7) toggleBox.BackgroundColor3 = defaultState and Theme.ToggleOn or Theme.ToggleOff toggleBox.BorderSizePixel = 0 toggleBox.ZIndex = 15 toggleBox.Parent = toggleFrame local boxBorder = Instance.new("UIStroke") boxBorder.Color = defaultState and Theme.Accent or Theme.Border boxBorder.Thickness = 1 boxBorder.Parent = toggleBox local switch = Instance.new("Frame") switch.Size = UDim2.new(0, 12, 0, 12) switch.Position = defaultState and UDim2.new(1, -13, 0.5, -6) or UDim2.new(0, 1, 0.5, -6) switch.BackgroundColor3 = Color3.fromRGB(255, 255, 255) switch.BorderSizePixel = 0 switch.ZIndex = 16 switch.Parent = toggleBox local state = defaultState or false local component = { frame = toggleFrame, getState = function() return state end, setState = function(newState) state = newState label.Text = (state and "[✓] " or "[ ] ") .. text safeTween(toggleBox, {BackgroundColor3 = state and Theme.ToggleOn or Theme.ToggleOff}, TweenInfo.new(0.2, Enum.EasingStyle.Quad)) safeTween(boxBorder, {Color = state and Theme.Accent or Theme.Border}, TweenInfo.new(0.2)) safeTween(switch, {Position = state and UDim2.new(1, -13, 0.5, -6) or UDim2.new(0, 1, 0.5, -6)}, TweenInfo.new(0.2, Enum.EasingStyle.Quad)) end } toggleFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then state = not state component.setState(state) if callback then local ok, err = pcall(callback, state) if not ok then warn("Toggle callback error:", err) end end end end) toggleFrame.MouseEnter:Connect(function() safeTween(togBorder, {Color = Theme.BorderActive}, TweenInfo.new(0.15)) end) toggleFrame.MouseLeave:Connect(function() safeTween(togBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) table.insert(self._components, component) return component end -- ========================================== -- COMPONENT: SLIDER -- ========================================== function OrlyxisHub:AddSlider(section, text, min, max, default, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 min = min or 0 max = max or 100 default = math.clamp(default or min, min, max) local sliderFrame = Instance.new("Frame") sliderFrame.Size = UDim2.new(1, 0, 0, 38) sliderFrame.BackgroundColor3 = Theme.BG sliderFrame.BorderSizePixel = 0 sliderFrame.LayoutOrder = order sliderFrame.ZIndex = 14 sliderFrame.Parent = section local sBorder = Instance.new("UIStroke") sBorder.Color = Theme.Border sBorder.Thickness = 1 sBorder.Parent = sliderFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(0.5, -6, 0, 14) label.Position = UDim2.new(0, 7, 0, 3) label.BackgroundTransparency = 1 label.Text = text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = sliderFrame local valueLabel = Instance.new("TextLabel") valueLabel.Size = UDim2.new(0.5, -6, 0, 14) valueLabel.Position = UDim2.new(0.5, 0, 0, 3) valueLabel.BackgroundTransparency = 1 valueLabel.Text = tostring(default) valueLabel.TextColor3 = Theme.Accent valueLabel.Font = Enum.Font.Code valueLabel.TextSize = 10 valueLabel.TextXAlignment = Enum.TextXAlignment.Right valueLabel.ZIndex = 15 valueLabel.Parent = sliderFrame local track = Instance.new("Frame") track.Size = UDim2.new(1, -14, 0, 6) track.Position = UDim2.new(0, 7, 0, 22) track.BackgroundColor3 = Theme.ToggleOff track.BorderSizePixel = 0 track.ZIndex = 15 track.Parent = sliderFrame local trackBorder = Instance.new("UIStroke") trackBorder.Color = Theme.Border trackBorder.Thickness = 1 trackBorder.Parent = track local fill = Instance.new("Frame") local fillPercent = (default - min) / (max - min) fill.Size = UDim2.new(fillPercent, 0, 1, 0) fill.BackgroundColor3 = Theme.Accent fill.BorderSizePixel = 0 fill.ZIndex = 16 fill.Parent = track local knob = Instance.new("Frame") knob.Size = UDim2.new(0, 10, 0, 10) knob.Position = UDim2.new(fillPercent, -5, 0.5, -5) knob.BackgroundColor3 = Color3.fromRGB(255, 255, 255) knob.BorderSizePixel = 0 knob.ZIndex = 17 knob.Parent = track local knobBorder = Instance.new("UIStroke") knobBorder.Color = Theme.Accent knobBorder.Thickness = 2 knobBorder.Parent = knob local dragging = false local currentValue = default local function updateSlider(input) if not track or not track.Parent then return end local trackAbs = track.AbsolutePosition.X local trackSize = track.AbsoluteSize.X local relativeX = math.clamp((input.Position.X - trackAbs) / trackSize, 0, 1) currentValue = math.floor(min + (relativeX * (max - min))) valueLabel.Text = tostring(currentValue) fill.Size = UDim2.new(relativeX, 0, 1, 0) knob.Position = UDim2.new(relativeX, -5, 0.5, -5) if callback then local ok, err = pcall(callback, currentValue) if not ok then warn("Slider callback error:", err) end end end local trackInputBegan = track.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true updateSlider(input) end end) table.insert(self._connections, trackInputBegan) local inputChanged = UserInputService.InputChanged:Connect(function(input) if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then updateSlider(input) end end) table.insert(self._connections, inputChanged) local inputEnded = UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = false end end) table.insert(self._connections, inputEnded) sliderFrame.MouseEnter:Connect(function() safeTween(sBorder, {Color = Theme.BorderActive}, TweenInfo.new(0.15)) end) sliderFrame.MouseLeave:Connect(function() safeTween(sBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) return { frame = sliderFrame, getValue = function() return currentValue end, setValue = function(val) val = math.clamp(val, min, max) currentValue = val valueLabel.Text = tostring(val) local rel = (val - min) / (max - min) fill.Size = UDim2.new(rel, 0, 1, 0) knob.Position = UDim2.new(rel, -5, 0.5, -5) end } end -- ========================================== -- COMPONENT: DROPDOWN (FIXED) -- ========================================== function OrlyxisHub:AddDropdown(section, text, options, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 options = options or {} local dropdownFrame = Instance.new("Frame") dropdownFrame.Size = UDim2.new(1, 0, 0, 26) dropdownFrame.BackgroundColor3 = Theme.BG dropdownFrame.BorderSizePixel = 0 dropdownFrame.LayoutOrder = order dropdownFrame.ZIndex = 14 dropdownFrame.ClipsDescendants = true dropdownFrame.Parent = section local dBorder = Instance.new("UIStroke") dBorder.Color = Theme.Border dBorder.Thickness = 1 dBorder.Parent = dropdownFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -36, 0, 26) label.Position = UDim2.new(0, 7, 0, 0) label.BackgroundTransparency = 1 label.Text = text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = dropdownFrame local arrow = Instance.new("TextLabel") arrow.Size = UDim2.new(0, 18, 0, 26) arrow.Position = UDim2.new(1, -22, 0, 0) arrow.BackgroundTransparency = 1 arrow.Text = "v" arrow.TextColor3 = Theme.TextDim arrow.Font = Enum.Font.Code arrow.TextSize = 10 arrow.ZIndex = 15 arrow.Parent = dropdownFrame local optionsContainer = Instance.new("Frame") optionsContainer.Size = UDim2.new(1, 0, 0, #options * 22) optionsContainer.Position = UDim2.new(0, 0, 0, 26) optionsContainer.BackgroundColor3 = Theme.BGSecondary optionsContainer.BorderSizePixel = 0 optionsContainer.ZIndex = 16 optionsContainer.Visible = false optionsContainer.Parent = dropdownFrame local opBorder = Instance.new("UIStroke") opBorder.Color = Theme.Border opBorder.Thickness = 1 opBorder.Parent = optionsContainer local optionsLayout = Instance.new("UIListLayout") optionsLayout.Parent = optionsContainer local isOpen = false local selectedOption = options[1] or "Select..." local optionButtons = {} for i, option in ipairs(options) do local optionBtn = Instance.new("TextButton") optionBtn.Size = UDim2.new(1, 0, 0, 22) optionBtn.BackgroundColor3 = Theme.BGSecondary optionBtn.Text = " " .. option optionBtn.TextColor3 = Theme.TextDim optionBtn.Font = Enum.Font.Code optionBtn.TextSize = 9 optionBtn.TextXAlignment = Enum.TextXAlignment.Left optionBtn.ZIndex = 17 optionBtn.Parent = optionsContainer table.insert(optionButtons, optionBtn) optionBtn.MouseButton1Click:Connect(function() selectedOption = option label.Text = text .. ": " .. option isOpen = false optionsContainer.Visible = false arrow.Text = "v" dropdownFrame.Size = UDim2.new(1, 0, 0, 26) if callback then local ok, err = pcall(callback, option) if not ok then warn("Dropdown callback error:", err) end end end) optionBtn.MouseEnter:Connect(function() optionBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 50) optionBtn.TextColor3 = Theme.Accent end) optionBtn.MouseLeave:Connect(function() optionBtn.BackgroundColor3 = Theme.BGSecondary optionBtn.TextColor3 = Theme.TextDim end) end local dropdownObj = { frame = dropdownFrame, isOpen = false, Close = function() isOpen = false dropdownObj.isOpen = false optionsContainer.Visible = false arrow.Text = "v" dropdownFrame.Size = UDim2.new(1, 0, 0, 26) end, getSelected = function() return selectedOption end } dropdownFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then isOpen = not isOpen dropdownObj.isOpen = isOpen optionsContainer.Visible = isOpen arrow.Text = isOpen and "^" or "v" if isOpen then dropdownFrame.Size = UDim2.new(1, 0, 0, 26 + optionsContainer.Size.Y.Offset) else dropdownFrame.Size = UDim2.new(1, 0, 0, 26) end end end) dropdownFrame.MouseEnter:Connect(function() safeTween(dBorder, {Color = Theme.BorderActive}, TweenInfo.new(0.15)) end) dropdownFrame.MouseLeave:Connect(function() safeTween(dBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) table.insert(self._dropdowns, dropdownObj) return dropdownObj end -- ========================================== -- COMPONENT: TEXTBOX -- ========================================== function OrlyxisHub:AddTextBox(section, labelText, placeholder, callback, order, options) if self._isDestroyed or not section then return nil end order = order or 1 options = options or {} local boxFrame = Instance.new("Frame") boxFrame.Size = UDim2.new(1, 0, 0, 46) boxFrame.BackgroundColor3 = Theme.BG boxFrame.BorderSizePixel = 0 boxFrame.LayoutOrder = order boxFrame.ZIndex = 14 boxFrame.Parent = section local bBorder = Instance.new("UIStroke") bBorder.Color = Theme.Border bBorder.Thickness = 1 bBorder.Parent = boxFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -10, 0, 14) label.Position = UDim2.new(0, 5, 0, 3) label.BackgroundTransparency = 1 label.Text = labelText label.TextColor3 = Theme.TextDim label.Font = Enum.Font.Code label.TextSize = 9 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = boxFrame local textBox = Instance.new("TextBox") textBox.Size = UDim2.new(1, -10, 0, 20) textBox.Position = UDim2.new(0, 5, 0, 20) textBox.BackgroundColor3 = Theme.BGSecondary textBox.Text = "" textBox.PlaceholderText = placeholder or "Type..." textBox.PlaceholderColor3 = Theme.TextDim textBox.TextColor3 = Theme.Text textBox.Font = Enum.Font.Code textBox.TextSize = 10 textBox.ClearTextOnFocus = false textBox.ZIndex = 15 textBox.Parent = boxFrame local tBorder = Instance.new("UIStroke") tBorder.Color = Theme.Border tBorder.Thickness = 1 tBorder.Parent = textBox textBox.Focused:Connect(function() safeTween(tBorder, {Color = Theme.Accent}, TweenInfo.new(0.2)) end) textBox.FocusLost:Connect(function() safeTween(tBorder, {Color = Theme.Border}, TweenInfo.new(0.2)) if callback then local ok, err = pcall(callback, textBox.Text) if not ok then warn("TextBox callback error:", err) end end end) -- Number only option if options.NumberOnly then textBox:GetPropertyChangedSignal("Text"):Connect(function() local newText = textBox.Text:gsub("[^%d%.%-]", "") if newText ~= textBox.Text then textBox.Text = newText end end) end return { frame = boxFrame, getText = function() return textBox.Text end, setText = function(txt) textBox.Text = txt end } end -- ========================================== -- COMPONENT: KEYBIND (FIXED) -- ========================================== function OrlyxisHub:AddKeybind(section, text, defaultKey, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 local keyFrame = Instance.new("Frame") keyFrame.Size = UDim2.new(1, 0, 0, 26) keyFrame.BackgroundColor3 = Theme.BG keyFrame.BorderSizePixel = 0 keyFrame.LayoutOrder = order keyFrame.ZIndex = 14 keyFrame.Parent = section local kBorder = Instance.new("UIStroke") kBorder.Color = Theme.Border kBorder.Thickness = 1 kBorder.Parent = keyFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -56, 1, 0) label.Position = UDim2.new(0, 7, 0, 0) label.BackgroundTransparency = 1 label.Text = text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = keyFrame local keyBtn = Instance.new("TextButton") keyBtn.Size = UDim2.new(0, 36, 0, 18) keyBtn.Position = UDim2.new(1, -44, 0.5, -9) keyBtn.BackgroundColor3 = Theme.BGSecondary keyBtn.Text = defaultKey or "..." keyBtn.TextColor3 = Theme.Accent keyBtn.Font = Enum.Font.Code keyBtn.TextSize = 9 keyBtn.ZIndex = 15 keyBtn.Parent = keyFrame local keyBtnBorder = Instance.new("UIStroke") keyBtnBorder.Color = Theme.Accent keyBtnBorder.Thickness = 1 keyBtnBorder.Parent = keyBtn local listening = false local currentKey = defaultKey or "None" local kbObj = { frame = keyFrame, key = currentKey, callback = callback, getKey = function() return currentKey end } keyBtn.MouseButton1Click:Connect(function() if self._isDestroyed then return end listening = true keyBtn.Text = "..." keyBtn.TextColor3 = Theme.Warning end) -- Store for global keybind handler table.insert(self._keybinds, kbObj) -- Local listener for setting key local setConn = UserInputService.InputBegan:Connect(function(input, gameProcessed) if not listening then return end if gameProcessed then return end if input.UserInputType == Enum.UserInputType.Keyboard then currentKey = input.KeyCode.Name kbObj.key = currentKey keyBtn.Text = currentKey keyBtn.TextColor3 = Theme.Accent listening = false end end) table.insert(self._connections, setConn) keyFrame.MouseEnter:Connect(function() safeTween(kBorder, {Color = Theme.BorderActive}, TweenInfo.new(0.15)) end) keyFrame.MouseLeave:Connect(function() safeTween(kBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) return kbObj end -- ========================================== -- COMPONENT: COLOR PICKER (FIXED) -- ========================================== function OrlyxisHub:AddColorPicker(section, text, defaultColor, callback, order) if self._isDestroyed or not section then return nil end order = order or 1 defaultColor = defaultColor or Color3.fromRGB(255, 0, 0) local colorFrame = Instance.new("Frame") colorFrame.Size = UDim2.new(1, 0, 0, 26) colorFrame.BackgroundColor3 = Theme.BG colorFrame.BorderSizePixel = 0 colorFrame.LayoutOrder = order colorFrame.ZIndex = 14 colorFrame.Parent = section local cBorder = Instance.new("UIStroke") cBorder.Color = Theme.Border cBorder.Thickness = 1 cBorder.Parent = colorFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, -50, 1, 0) label.Position = UDim2.new(0, 7, 0, 0) label.BackgroundTransparency = 1 label.Text = text label.TextColor3 = Theme.Text label.Font = Enum.Font.Code label.TextSize = 10 label.TextXAlignment = Enum.TextXAlignment.Left label.ZIndex = 15 label.Parent = colorFrame local preview = Instance.new("Frame") preview.Size = UDim2.new(0, 22, 0, 16) preview.Position = UDim2.new(1, -30, 0.5, -8) preview.BackgroundColor3 = defaultColor preview.BorderSizePixel = 0 preview.ZIndex = 15 preview.Parent = colorFrame local pBorder = Instance.new("UIStroke") pBorder.Color = Color3.fromRGB(255,255,255) pBorder.Thickness = 1 pBorder.Parent = preview -- Popup Panel local popup = Instance.new("Frame") popup.Name = "ColorPopup" popup.Size = UDim2.new(0, 180, 0, 0) popup.BackgroundColor3 = Theme.BGSecondary popup.BorderSizePixel = 0 popup.ZIndex = 100 popup.ClipsDescendants = true popup.Visible = false popup.Parent = self.screenGui local popBorder = Instance.new("UIStroke") popBorder.Color = Theme.Border popBorder.Thickness = 1 popBorder.Parent = popup local presets = { Color3.fromRGB(255,0,0), Color3.fromRGB(0,255,0), Color3.fromRGB(0,0,255), Color3.fromRGB(255,255,0), Color3.fromRGB(255,0,255), Color3.fromRGB(0,255,255), Color3.fromRGB(255,128,0), Color3.fromRGB(128,0,255), Color3.fromRGB(255,255,255), Color3.fromRGB(128,128,128), Color3.fromRGB(0,0,0), Color3.fromRGB(255,100,100), Color3.fromRGB(100,255,100), Color3.fromRGB(100,100,255), Color3.fromRGB(255,200,100), Color3.fromRGB(200,100,255), } local currentColor = defaultColor local rVal = math.floor(defaultColor.R*255) local gVal = math.floor(defaultColor.G*255) local bVal = math.floor(defaultColor.B*255) for i, preset in ipairs(presets) do local btn = Instance.new("TextButton") btn.Size = UDim2.new(0, 32, 0, 18) btn.Position = UDim2.new(0, 6 + ((i-1)%4)*38, 0, 6 + math.floor((i-1)/4)*22) btn.BackgroundColor3 = preset btn.Text = "" btn.BorderSizePixel = 0 btn.ZIndex = 101 btn.Parent = popup local btnStroke = Instance.new("UIStroke") btnStroke.Color = Theme.Border btnStroke.Thickness = 1 btnStroke.Parent = btn btn.MouseEnter:Connect(function() btnStroke.Color = Theme.Accent end) btn.MouseLeave:Connect(function() btnStroke.Color = Theme.Border end) btn.MouseButton1Click:Connect(function() currentColor = preset preview.BackgroundColor3 = currentColor rVal = math.floor(preset.R*255) gVal = math.floor(preset.G*255) bVal = math.floor(preset.B*255) if callback then local ok, err = pcall(callback, currentColor) if not ok then warn("ColorPicker callback error:", err) end end end) end -- RGB Sliders local rgbFillRefs = {} local rgbKnobRefs = {} local function createMiniSlider(y, name, val, updateFn) local sFrame = Instance.new("Frame") sFrame.Size = UDim2.new(1, -12, 0, 20) sFrame.Position = UDim2.new(0, 6, 0, y) sFrame.BackgroundTransparency = 1 sFrame.ZIndex = 101 sFrame.Parent = popup local sLabel = Instance.new("TextLabel") sLabel.Size = UDim2.new(0, 14, 1, 0) sLabel.BackgroundTransparency = 1 sLabel.Text = name sLabel.TextColor3 = name == "R" and Theme.Danger or (name == "G" and Theme.Success or Theme.Accent3) sLabel.Font = Enum.Font.Code sLabel.TextSize = 9 sLabel.ZIndex = 102 sLabel.Parent = sFrame local sTrack = Instance.new("Frame") sTrack.Size = UDim2.new(1, -40, 0, 4) sTrack.Position = UDim2.new(0, 18, 0.5, -2) sTrack.BackgroundColor3 = Theme.ToggleOff sTrack.BorderSizePixel = 0 sTrack.ZIndex = 102 sTrack.Parent = sFrame local sFill = Instance.new("Frame") sFill.Size = UDim2.new(val/255, 0, 1, 0) sFill.BackgroundColor3 = name == "R" and Theme.Danger or (name == "G" and Theme.Success or Theme.Accent3) sFill.BorderSizePixel = 0 sFill.ZIndex = 103 sFill.Parent = sTrack local sKnob = Instance.new("Frame") sKnob.Size = UDim2.new(0, 6, 0, 10) sKnob.Position = UDim2.new(val/255, -3, 0.5, -5) sKnob.BackgroundColor3 = Color3.fromRGB(255,255,255) sKnob.BorderSizePixel = 0 sKnob.ZIndex = 104 sKnob.Parent = sTrack rgbFillRefs[name] = sFill rgbKnobRefs[name] = sKnob local sDragging = false local sTrackInput = sTrack.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then sDragging = true local rel = math.clamp((input.Position.X - sTrack.AbsolutePosition.X) / sTrack.AbsoluteSize.X, 0, 1) local newVal = math.floor(rel * 255) updateFn(newVal) sFill.Size = UDim2.new(rel, 0, 1, 0) sKnob.Position = UDim2.new(rel, -3, 0.5, -5) end end) table.insert(self._connections, sTrackInput) local sInputChanged = UserInputService.InputChanged:Connect(function(input) if sDragging and input.UserInputType == Enum.UserInputType.MouseMovement then if not sTrack or not sTrack.Parent then sDragging = false return end local rel = math.clamp((input.Position.X - sTrack.AbsolutePosition.X) / sTrack.AbsoluteSize.X, 0, 1) local newVal = math.floor(rel * 255) updateFn(newVal) sFill.Size = UDim2.new(rel, 0, 1, 0) sKnob.Position = UDim2.new(rel, -3, 0.5, -5) end end) table.insert(self._connections, sInputChanged) local sInputEnded = UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then sDragging = false end end) table.insert(self._connections, sInputEnded) end createMiniSlider(100, "R", rVal, function(v) rVal = v currentColor = Color3.fromRGB(rVal, gVal, bVal) preview.BackgroundColor3 = currentColor if callback then pcall(callback, currentColor) end end) createMiniSlider(122, "G", gVal, function(v) gVal = v currentColor = Color3.fromRGB(rVal, gVal, bVal) preview.BackgroundColor3 = currentColor if callback then pcall(callback, currentColor) end end) createMiniSlider(144, "B", bVal, function(v) bVal = v currentColor = Color3.fromRGB(rVal, gVal, bVal) preview.BackgroundColor3 = currentColor if callback then pcall(callback, currentColor) end end) local closePop = Instance.new("TextButton") closePop.Size = UDim2.new(0, 14, 0, 14) closePop.Position = UDim2.new(1, -18, 0, 2) closePop.BackgroundTransparency = 1 closePop.Text = "×" closePop.TextColor3 = Theme.Danger closePop.Font = Enum.Font.Code closePop.TextSize = 12 closePop.ZIndex = 101 closePop.Parent = popup local popupObj = { frame = popup, isOpen = false, Close = function() popupObj.isOpen = false safeTween(popup, {Size = UDim2.new(0, 180, 0, 0)}, TweenInfo.new(0.2)) task.delay(0.2, function() if popup and popup.Parent then popup.Visible = false end end) end } local function updatePopupPosition() if not preview or not preview.Parent then return end local absPos = preview.AbsolutePosition popup.Position = UDim2.new(0, absPos.X - 160, 0, absPos.Y + 20) end colorFrame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then popupObj.isOpen = not popupObj.isOpen if popupObj.isOpen then updatePopupPosition() popup.Visible = true safeTween(popup, {Size = UDim2.new(0, 180, 0, 170)}, TweenInfo.new(0.2)) else popupObj.Close() end end end) closePop.MouseButton1Click:Connect(function() popupObj.Close() end) colorFrame.MouseEnter:Connect(function() safeTween(cBorder, {Color = Theme.BorderActive}, TweenInfo.new(0.15)) end) colorFrame.MouseLeave:Connect(function() safeTween(cBorder, {Color = Theme.Border}, TweenInfo.new(0.15)) end) table.insert(self._popups, popupObj) return { frame = colorFrame, getColor = function() return preview.BackgroundColor3 end } end -- ========================================== -- INTRO ANIMATION -- ========================================== function OrlyxisHub:_playIntro() self.mainWindow.Size = UDim2.new(0, 0, 0, 0) self.mainWindow.BackgroundTransparency = 1 safeTween(self.mainWindow, { Size = FULL_SIZE, BackgroundTransparency = 0 }, TweenInfo.new(0.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out)) task.delay(0.15, function() if self._isDestroyed then return end self.sidebar.Position = UDim2.new(0, -SIDEBAR_W, 0, 0) safeTween(self.sidebar, {Position = UDim2.new(0, 0, 0, 0)}, TweenInfo.new(0.4, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)) end) task.delay(0.3, function() if self._isDestroyed then return end local avatar = self.sidebar:FindFirstChild("AvatarContainer") if avatar then avatar.Size = UDim2.new(0, 0, 0, 0) safeTween(avatar, {Size = UDim2.new(0, 52, 0, 52)}, TweenInfo.new(0.4, Enum.EasingStyle.Back, Enum.EasingDirection.Out)) end end) task.delay(0.4, function() if self._isDestroyed then return end for i, tab in ipairs(self._tabs) do tab.button.Position = UDim2.new(0, -120, 0, tab.button.Position.Y.Offset) safeTween(tab.button, {Position = UDim2.new(0.5, -50, 0, tab.button.Position.Y.Offset)}, TweenInfo.new(0.3 + i*0.05, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)) end end) end -- ========================================== -- DESTROY / CLEANUP -- ========================================== function OrlyxisHub:Destroy() if self._isDestroyed then return end self._isDestroyed = true disconnectTable(self._connections) disconnectTable(self._floatingVFX) if self._floatingIcon then self._floatingIcon:Destroy() self._floatingIcon = nil end if self.screenGui then self.screenGui:Destroy() end -- Clear references self._tabs = {} self._components = {} self._dropdowns = {} self._popups = {} self._keybinds = {} self._particles = {} end -- ========================================== -- EXAMPLE USAGE (Comment out if using as library) -- ========================================== --[[ local Hub = OrlyxisHub.new() local mainTab = Hub:AddTab("Main", "▶", 1) local mainSec1 = Hub:AddSection(mainTab, "GENERAL", 1) Hub:AddButton(mainSec1, "Teleport Spawn", function() print("TP Spawn") end, 1) Hub:AddToggle(mainSec1, "Auto Farm", false, function(s) print("Farm:", s) end, 2) Hub:AddSlider(mainSec1, "Speed", 16, 500, 100, function(v) print("Spd:", v) end, 3) Hub:AddDropdown(mainSec1, "Mode", {"Legit","Rage","Silent"}, function(c) print("Mode:", c) end, 4) Hub:AddTextBox(mainSec1, "Target", "Username...", function(t) print("Target:", t) end, 5) local mainSec2 = Hub:AddSection(mainTab, "EXTRA", 2) Hub:AddButton(mainSec2, "Full Heal", function() print("Heal") end, 1) Hub:AddToggle(mainSec2, "Auto Collect", false, function(s) print("Collect:", s) end, 2) Hub:AddKeybind(mainSec2, "Panic Key", "P", function() print("PANIC!") end, 3) local playerTab = Hub:AddTab("Player", "◆", 2) local pSec1 = Hub:AddSection(playerTab, "CHAR", 1) Hub:AddToggle(pSec1, "Inf Jump", false, function(s) print("Jump:", s) end, 1) Hub:AddToggle(pSec1, "Fly", false, function(s) print("Fly:", s) end, 2) Hub:AddSlider(pSec1, "Jump Power", 50, 500, 100, function(v) print("JP:", v) end, 3) local pSec2 = Hub:AddSection(playerTab, "VISUAL", 2) Hub:AddToggle(pSec2, "ESP", false, function(s) print("ESP:", s) end, 1) Hub:AddColorPicker(pSec2, "ESP Color", Color3.fromRGB(255,0,0), function(c) print("ESP:", c) end, 2) local miscTab = Hub:AddTab("Misc", "⚙", 3) local miscSec = Hub:AddSection(miscTab, "UTILS", 1) Hub:AddButton(miscSec, "Rejoin", function() print("Rejoin") end, 1) Hub:AddButton(miscSec, "Unload", function() Hub:Destroy() end, 2) --]] print("✅ Orlyxis Pixel Hub Library Loaded!") print("👤 Player:", player.Name) print("💻 Executor:", currentExecutor) print("📦 Usage: local Hub = OrlyxisHub.new()") return OrlyxisHub