-- XERON Engine Plugin for Roblox Studio -- Version: 1.0.0 -- Connects to xeron-labs.com to receive AI-generated Lua code local HttpService = game:GetService("HttpService") local RunService = game:GetService("RunService") local BASE = "https://www.xeron-labs.com/api/plugin" local TOKEN_KEY = "XERON_Token" -- ─── Widget ─────────────────────────────────────────────────────────────────── local widgetInfo = DockWidgetPluginGuiInfo.new( Enum.InitialDockState.Right, true, false, 320, 560, 280, 400 ) local widget = plugin:CreateDockWidgetPluginGui("XERONEngine", widgetInfo) widget.Title = "XERON Engine" local toolbar = plugin:CreateToolbar("XERON") local btn = toolbar:CreateButton("XERON", "Toggle XERON Engine", "rbxassetid://0") btn.Click:Connect(function() widget.Enabled = not widget.Enabled end) -- ─── Screens ────────────────────────────────────────────────────────────────── local screens = {} local function showScreen(name) for _, v in pairs(screens) do v.Visible = false end if screens[name] then screens[name].Visible = true end end -- ── CONNECT SCREEN ──────────────────────────────────────────────────────────── local connectFrame = Instance.new("Frame") connectFrame.Size = UDim2.new(1, 0, 1, 0) connectFrame.BackgroundColor3 = Color3.fromRGB(3, 8, 15) connectFrame.BorderSizePixel = 0 connectFrame.Parent = widget screens["CONNECT"] = connectFrame local function makeLabel(parent, text, size, pos, textSize, font, color) local l = Instance.new("TextLabel") l.Size = size l.Position = pos l.Text = text l.TextColor3 = color or Color3.fromRGB(238, 244, 255) l.TextSize = textSize or 13 l.Font = font or Enum.Font.Gotham l.BackgroundTransparency = 1 l.TextXAlignment = Enum.TextXAlignment.Left l.TextWrapped = true l.Parent = parent return l end makeLabel(connectFrame, "XERON Engine", UDim2.new(1, 0, 0, 36), UDim2.new(0, 12, 0, 18), 20, Enum.Font.GothamBold, Color3.fromRGB(238, 244, 255)) makeLabel(connectFrame, "Enter your 6-digit connection code:", UDim2.new(1, -24, 0, 32), UDim2.new(0, 12, 0, 62), 12, Enum.Font.Gotham, Color3.fromRGB(160, 184, 204)) -- 6 code boxes local codeBoxes = {} local codeFrame = Instance.new("Frame") codeFrame.Size = UDim2.new(1, -24, 0, 52) codeFrame.Position = UDim2.new(0, 12, 0, 100) codeFrame.BackgroundTransparency = 1 codeFrame.Parent = connectFrame for i = 1, 6 do local box = Instance.new("TextBox") box.Size = UDim2.new(0, 40, 0, 48) box.Position = UDim2.new(0, (i - 1) * 46, 0, 0) box.BackgroundColor3 = Color3.fromRGB(7, 24, 40) box.BorderColor3 = Color3.fromRGB(0, 80, 180) box.BorderSizePixel = 1 box.Text = "" box.PlaceholderText = "·" box.TextColor3 = Color3.fromRGB(238, 244, 255) box.PlaceholderColor3 = Color3.fromRGB(80, 100, 140) box.TextSize = 22 box.Font = Enum.Font.GothamBold box.TextXAlignment = Enum.TextXAlignment.Center box.MaxVisibleGraphemes = 1 box.ClearTextOnFocus = false box.Parent = codeFrame codeBoxes[i] = box local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = box -- auto-advance on input box:GetPropertyChangedSignal("Text"):Connect(function() local c = box.Text:upper():gsub("[^A-Z0-9]", "") box.Text = c ~= "" and c:sub(1, 1) or "" if c ~= "" and i < 6 then codeBoxes[i + 1]:CaptureFocus() end end) end local connectBtn = Instance.new("TextButton") connectBtn.Size = UDim2.new(1, -24, 0, 42) connectBtn.Position = UDim2.new(0, 12, 0, 168) connectBtn.BackgroundColor3 = Color3.fromRGB(0, 100, 220) connectBtn.Text = "Connect" connectBtn.TextColor3 = Color3.fromRGB(255, 255, 255) connectBtn.TextSize = 14 connectBtn.Font = Enum.Font.GothamBold connectBtn.AutoButtonColor = true connectBtn.Parent = connectFrame local cc = Instance.new("UICorner"); cc.CornerRadius = UDim.new(0, 8); cc.Parent = connectBtn local errorLabel = makeLabel(connectFrame, "", UDim2.new(1, -24, 0, 36), UDim2.new(0, 12, 0, 220), 11, Enum.Font.Gotham, Color3.fromRGB(255, 80, 80)) makeLabel(connectFrame, "Get this plugin at:\nxeron-labs.com/download", UDim2.new(1, -24, 0, 36), UDim2.new(0, 12, 0, 264), 10, Enum.Font.Gotham, Color3.fromRGB(80, 120, 180)) -- ── HOME SCREEN ─────────────────────────────────────────────────────────────── local homeFrame = Instance.new("Frame") homeFrame.Size = UDim2.new(1, 0, 1, 0) homeFrame.BackgroundColor3 = Color3.fromRGB(3, 8, 15) homeFrame.BorderSizePixel = 0 homeFrame.Visible = false homeFrame.Parent = widget screens["HOME"] = homeFrame makeLabel(homeFrame, "XERON Engine", UDim2.new(1, 0, 0, 36), UDim2.new(0, 12, 0, 14), 18, Enum.Font.GothamBold) local connDot = makeLabel(homeFrame, "● Connected", UDim2.new(1, -24, 0, 22), UDim2.new(0, 12, 0, 52), 11, Enum.Font.GothamBold, Color3.fromRGB(0, 200, 120)) local emailLabel = makeLabel(homeFrame, "—", UDim2.new(1, -24, 0, 22), UDim2.new(0, 12, 0, 76), 11, Enum.Font.Gotham, Color3.fromRGB(160, 184, 204)) local planLabel = makeLabel(homeFrame, "Plan: free", UDim2.new(1, -24, 0, 22), UDim2.new(0, 12, 0, 98), 11, Enum.Font.GothamBold, Color3.fromRGB(0, 200, 120)) local creditsLabel = makeLabel(homeFrame, "🪙 Credits: 0", UDim2.new(1, -24, 0, 22), UDim2.new(0, 12, 0, 120), 11, Enum.Font.GothamBold, Color3.fromRGB(212, 160, 23)) local sep = Instance.new("Frame") sep.Size = UDim2.new(1, -24, 0, 1); sep.Position = UDim2.new(0, 12, 0, 150) sep.BackgroundColor3 = Color3.fromRGB(20, 40, 60); sep.BorderSizePixel = 0; sep.Parent = homeFrame local statusLabel = makeLabel(homeFrame, "Waiting for code from website...", UDim2.new(1, -24, 0, 60), UDim2.new(0, 12, 0, 160), 11, Enum.Font.Gotham, Color3.fromRGB(100, 150, 200)) local disconnectBtn = Instance.new("TextButton") disconnectBtn.Size = UDim2.new(1, -24, 0, 34) disconnectBtn.Position = UDim2.new(0, 12, 1, -48) disconnectBtn.BackgroundColor3 = Color3.fromRGB(40, 15, 15) disconnectBtn.Text = "Disconnect" disconnectBtn.TextColor3 = Color3.fromRGB(220, 80, 80) disconnectBtn.TextSize = 12 disconnectBtn.Font = Enum.Font.GothamBold disconnectBtn.AutoButtonColor = true disconnectBtn.Parent = homeFrame local dc = Instance.new("UICorner"); dc.CornerRadius = UDim.new(0, 6); dc.Parent = disconnectBtn -- ─── Connect logic ──────────────────────────────────────────────────────────── local function setHomeUser(data) if data.user then emailLabel.Text = data.user.email or "—" planLabel.Text = "Plan: " .. (data.user.plan or "free") creditsLabel.Text = "🪙 Credits: " .. tostring(data.user.credits or 0) end end connectBtn.MouseButton1Click:Connect(function() local code = "" for i = 1, 6 do code = code .. codeBoxes[i].Text:upper() end if #code ~= 6 then errorLabel.Text = "⚠ Enter all 6 characters" return end connectBtn.Text = "Connecting..." connectBtn.Active = false errorLabel.Text = "" local ok, result = pcall(function() local resp = HttpService:RequestAsync({ Url = BASE .. "/connect", Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = HttpService:JSONEncode({ code = code, platform = "roblox" }), }) return HttpService:JSONDecode(resp.Body) end) connectBtn.Text = "Connect" connectBtn.Active = true if ok and result and result.token then plugin:SetSetting(TOKEN_KEY, result.token) setHomeUser(result) statusLabel.Text = "✓ Connected! Waiting for code..." showScreen("HOME") else local msg = (ok and result and result.error) or "Connection failed" errorLabel.Text = "✗ " .. tostring(msg) end end) disconnectBtn.MouseButton1Click:Connect(function() plugin:SetSetting(TOKEN_KEY, "") for i = 1, 6 do codeBoxes[i].Text = "" end errorLabel.Text = "" statusLabel.Text = "Waiting for code from website..." showScreen("CONNECT") end) -- ─── Poll every 3 seconds ───────────────────────────────────────────────────── local timeSince = 0 RunService.Heartbeat:Connect(function(dt) timeSince = timeSince + dt if timeSince < 3 then return end timeSince = 0 local token = plugin:GetSetting(TOKEN_KEY) if not token or token == "" then return end local ok, result = pcall(function() local resp = HttpService:RequestAsync({ Url = BASE .. "/pending", Method = "GET", Headers = { ["X-Session-Token"] = token }, }) return HttpService:JSONDecode(resp.Body) end) if not ok or not result or not result.pending then return end for _, item in ipairs(result.pending) do local fileName = item.file_name or "XeronGenerated" local insertOk, insertErr = pcall(function() local fn = loadstring(item.code) if fn then fn() end end) if insertOk then statusLabel.Text = "✓ Inserted: " .. fileName else statusLabel.Text = "✗ Error: " .. tostring(insertErr):sub(1, 60) end -- Confirm delivery pcall(function() HttpService:RequestAsync({ Url = BASE .. "/confirm", Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = HttpService:JSONEncode({ insertion_id = item.id }), }) end) end end) -- ─── Start ──────────────────────────────────────────────────────────────────── local savedToken = plugin:GetSetting(TOKEN_KEY) if savedToken and savedToken ~= "" then showScreen("HOME") else showScreen("CONNECT") end