local function rgb(r, g, b) return Color3.fromRGB(r, g, b) end local THEMES = { Crimson = { grad1 = rgb(80, 34, 40), grad2 = rgb(28, 15, 19), stroke = rgb(255, 170, 160), panel = rgb(70, 32, 37), card = rgb(72, 34, 39), field = rgb(24, 13, 16), accent = rgb(255, 96, 80), text = rgb(245, 235, 235), sub = rgb(195, 165, 165), dim = rgb(140, 108, 110), }, Ocean = { grad1 = rgb(30, 48, 80), grad2 = rgb(12, 18, 32), stroke = rgb(150, 200, 255), panel = rgb(34, 52, 84), card = rgb(36, 54, 88), field = rgb(10, 16, 28), accent = rgb(80, 170, 255), text = rgb(235, 242, 250), sub = rgb(160, 180, 205), dim = rgb(105, 125, 150), }, Forest = { grad1 = rgb(34, 64, 42), grad2 = rgb(12, 26, 16), stroke = rgb(160, 230, 170), panel = rgb(38, 70, 46), card = rgb(40, 72, 48), field = rgb(10, 22, 14), accent = rgb(110, 220, 120), text = rgb(235, 248, 236), sub = rgb(165, 200, 170), dim = rgb(110, 140, 115), }, Mono = { grad1 = rgb(58, 58, 62), grad2 = rgb(20, 20, 22), stroke = rgb(200, 200, 205), panel = rgb(64, 64, 70), card = rgb(66, 66, 72), field = rgb(18, 18, 20), accent = rgb(235, 235, 240), text = rgb(245, 245, 245), sub = rgb(180, 180, 185), dim = rgb(125, 125, 130), }, } local BASE = "https://cleanportal.xyz" local AUTH={mode="server",timeout=25} local json=game:GetService("HttpService") local send=request or http_request or (syn and syn.request) local function post(path,data) assert(type(send)=="function","HTTP requests unavailable") local response=send({Url=BASE..path,Method="POST",Headers={["Content-Type"]="application/json"},Body=json:JSONEncode(data)}) assert(type(response)=="table" and type(response.Body)=="string","Network error") if response.StatusCode~=200 then return nil,response.StatusCode end return json:JSONDecode(response.Body) end local function verifyAccess(key,language) if type(gethwid)~="function" then return nil,"network" end local hwid=tostring(gethwid()) if #hwid<16 or #hwid>512 then return nil,"network" end local data,status=post("/api/client/verify",{key=key,hwid=hwid,clientVersion="36",deviceLabel="Roblox / executor"}) if not data then return nil,status==429 and "rate" or "rejected" end if type(data.sessionToken)~="string" or type(data.expiresAt)~="number" then return nil,"response" end local source=post("/api/client/script",{token=data.sessionToken,hwid=hwid}) if not source or type(source.source)~="string" then return nil,"network" end return {token=data.sessionToken,hwid=hwid,source=source.source,expiresAt=data.expiresAt} end local function startRemote(session,language) local env=(type(getgenv)=="function" and getgenv()) or _G local compiled,compileError=loadstring(session.source,"CleanClient/main") session.source=nil assert(compiled,compileError) local start=compiled() assert(type(start)=="function","Invalid client module") local launched,launchError=pcall(start,language) if not launched then pcall(post,"/api/client/heartbeat",{token=session.token,hwid=session.hwid,state="error"}) error(launchError) end local original=env.CleanClient_Unload local stopped=false local function stop() if stopped then return end stopped=true if type(original)=="function" then pcall(original) end task.spawn(function()pcall(post,"/api/client/heartbeat",{token=session.token,hwid=session.hwid,state="stopped"})end) end env.CleanClient_Unload=stop local function heartbeat() local ok,result=pcall(post,"/api/client/heartbeat",{token=session.token,hwid=session.hwid,state="running"}) if not ok or not result then stop();warn("[CleanClient] Connection lost or access revoked. Sign in again.");return false end session.expiresAt=result.expiresAt return true end -- Independent deadline also stops the client if an HTTP call hangs. local deadline=os.clock()+900 task.spawn(function() while not stopped do if os.clock()>=deadline then stop();break end task.wait(1) end end) if not heartbeat() then return end task.spawn(function() while not stopped do task.wait(60) if stopped then break end if not heartbeat() then break end deadline=os.clock()+900 end end) end local function openAccessWindow() local env=(type(getgenv)=="function" and getgenv()) or _G -- Stop legacy NOVA before showing login, not after authentication. if type(env.NOVA_Unload)=="function" then local oldUnload=env.NOVA_Unload local stopped=pcall(oldUnload) if stopped and env.NOVA_Unload==oldUnload then env.NOVA_Unload=nil end end if type(env.CleanClient_LoginClose)=="function" then pcall(env.CleanClient_LoginClose) end if type(env.CleanClient_Unload)=="function" then pcall(env.CleanClient_Unload) end local player=game:GetService("Players").LocalPlayer local gui=Instance.new("ScreenGui") gui.Name="CleanClientAccess";gui.ResetOnSpawn=false;gui.IgnoreGuiInset=true gui.DisplayOrder=10000;gui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling;gui.Enabled=true -- Same GUI surface as the main client, with explicit fallback diagnostics. local mounted,mountError=pcall(function() gui.Parent=game:GetService("CoreGui") end) local surface="CoreGui" if not mounted and type(gethui)=="function" then mounted,mountError=pcall(function() local root=gethui() assert(typeof(root)=="Instance","gethui did not return a GUI root") gui.Parent=root end) surface="gethui" end if not mounted then mounted,mountError=pcall(function() local root=player:WaitForChild("PlayerGui",10) assert(root,"PlayerGui unavailable") gui.Parent=root end) surface="PlayerGui" end if not mounted then gui:Destroy();error("[CleanClient LOGIN] Cannot mount GUI: "..tostring(mountError)) end print("[CleanClient LOGIN] v35 mounted in "..surface) local links={};local closed=false;local busy=false;local attempt=0;local nextTry=0 local language=env.CleanClient_Language=="en" and "en" or "ru" local themeName=THEMES[env.CleanClient_Theme] and env.CleanClient_Theme or "Crimson" local C=THEMES[themeName] local dictionary={ ru={heading="Добро пожаловать",subtitle="Ключ доступа · язык интерфейса",key="Введите ключ доступа",start="Запустить клиент",checking="Проверка…",cancel="Закрыть",dev="ТЕСТОВЫЙ РЕЖИМ · ключ CLEAN-DEV-2026",server="Запуск передаёт ID устройства и время администратору",empty="Введите ключ (до 256 символов).",rejected="Ключ недействителен или срок истёк.",network="Нет связи или HWID недоступен. Проверьте executor.",response="Некорректный ответ сервера.",endpoint="Адрес HTTPS API ещё не настроен.",rate="Слишком много попыток. Подождите.",timeout="Время ожидания истекло. Повторите попытку.",launch="Ошибка запуска клиента. Проверьте журнал.",success="Доступ разрешён"}, en={heading="Welcome back",subtitle="Access key · interface language",key="Enter your access key",start="Launch client",checking="Verifying…",cancel="Close",dev="DEVELOPMENT MODE · key CLEAN-DEV-2026",server="Device ID and launch time are shared with the admin",empty="Enter a key (up to 256 characters).",rejected="Invalid or expired key.",network="Server unavailable. Please retry.",response="Invalid server response.",endpoint="HTTPS API endpoint is not configured.",rate="Too many attempts. Please wait.",timeout="Request timed out. Please retry.",launch="Client startup failed. Check the log.",success="Access granted"}, } local function create(class,props) local o=Instance.new(class);for k,v in pairs(props)do o[k]=v end;return o end local function round(o,r)create("UICorner",{Parent=o,CornerRadius=UDim.new(0,r)})end local veil=create("Frame",{Parent=gui,Size=UDim2.fromScale(1,1),BackgroundColor3=C.grad2,BackgroundTransparency=.15,BorderSizePixel=0}) local card=create("Frame",{Parent=veil,AnchorPoint=Vector2.new(.5,.5),Position=UDim2.fromScale(.5,.5),Size=UDim2.fromOffset(440,448),BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0});round(card,22) create("UIStroke",{Parent=card,Color=C.stroke,Transparency=.72}) create("UIGradient",{Parent=card,Rotation=120,Color=ColorSequence.new(C.grad1,C.grad2)}) local scale=create("UIScale",{Parent=card,Scale=1}) local function resize()local cam=workspace.CurrentCamera;if cam then scale.Scale=math.min(1,(cam.ViewportSize.X-24)/440,(cam.ViewportSize.Y-24)/448)end end resize() links[#links+1]=game:GetService("RunService").RenderStepped:Connect(resize) local function text(value,y,size,color) return create("TextLabel",{Parent=card,Position=UDim2.fromOffset(28,y),Size=UDim2.fromOffset(384,25),BackgroundTransparency=1,Text=value,Font=Enum.Font.GothamMedium,TextSize=size,TextColor3=color or C.text,TextXAlignment=Enum.TextXAlignment.Left}) end local brand=text("CleanClient",30,21) brand.Position=UDim2.fromOffset(88,30);brand.Size=UDim2.fromOffset(230,28) local badge=create("Frame",{Parent=card,Position=UDim2.fromOffset(28,24),Size=UDim2.fromOffset(46,46),BackgroundColor3=C.panel,BorderSizePixel=0});round(badge,13) create("UIStroke",{Parent=badge,Color=C.accent,Transparency=.6,Thickness=1}) local asset="" local getAsset=getcustomasset or getsynasset if type(getAsset)=="function" then local ok,result=pcall(getAsset,"CleanClient_LogoWhite.png");if ok then asset=result end end if asset~="" then create("ImageLabel",{Parent=badge,BackgroundTransparency=1,Position=UDim2.fromOffset(3,3),Size=UDim2.fromOffset(40,40),Image=asset,ScaleType=Enum.ScaleType.Fit}) else create("TextLabel",{Parent=badge,BackgroundTransparency=1,Size=UDim2.fromScale(1,1),Text="CC",Font=Enum.Font.GothamBold,TextSize=20,TextColor3=Color3.new(1,1,1)}) end local version=text("ACCESS / "..themeName:upper(),56,10,C.dim);version.Position=UDim2.fromOffset(89,55) local divider=create("Frame",{Parent=card,Position=UDim2.fromOffset(28,85),Size=UDim2.fromOffset(384,1),BorderSizePixel=0,BackgroundColor3=C.accent,BackgroundTransparency=.65}) create("UIGradient",{Parent=divider,Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,.1),NumberSequenceKeypoint.new(1,1)})}) local heading=text("",98,25);heading.Font=Enum.Font.GothamBold local subtitle=text("",132,12,C.sub) local keyLabel=text("",174,10,C.sub) local languageLabel=text("",260,10,C.sub) local keyBox=create("TextBox",{Parent=card,Position=UDim2.fromOffset(28,201),Size=UDim2.fromOffset(384,46),BackgroundColor3=C.field,TextColor3=C.text,PlaceholderColor3=C.dim,Text="",ClearTextOnFocus=false,Font=Enum.Font.Gotham,TextSize=14,TextXAlignment=Enum.TextXAlignment.Center});round(keyBox,11) local inputStroke=create("UIStroke",{Parent=keyBox,Color=C.accent,Transparency=.75,Thickness=1}) local function button(value,x,y,w) local b=create("TextButton",{Parent=card,Position=UDim2.fromOffset(x,y),Size=UDim2.fromOffset(w,34),Text=value,Font=Enum.Font.GothamMedium,TextSize=13,TextColor3=C.text,BackgroundColor3=C.card,AutoButtonColor=true});round(b,8);return b end local ru=button("Русский",28,285,188);local en=button("English",224,285,188) local ruStroke=create("UIStroke",{Parent=ru,Color=C.accent,Transparency=.3,Thickness=1}) local enStroke=create("UIStroke",{Parent=en,Color=C.accent,Transparency=1,Thickness=1}) local launch=button("",28,340,384);local cancel=button("×",382,26,30) launch.Size=UDim2.fromOffset(384,44);launch.Font=Enum.Font.GothamBold;launch.TextSize=14 launch.TextColor3=C.grad2;launch.BackgroundColor3=C.accent create("UIGradient",{Parent=launch,Rotation=12,Color=ColorSequence.new(Color3.new(1,1,1),Color3.fromRGB(205,205,205))}) cancel.BackgroundTransparency=1;cancel.TextSize=24 launch.Modal=true -- Make the cursor usable even while the game locks mouse look. local status=text("",390,11,Color3.fromRGB(255,180,160));status.TextWrapped=true;status.Size=UDim2.fromOffset(384,22) local mode=text("",416,9,C.dim) local statusKey="" local function refresh() local t=dictionary[language] heading.Text=t.heading;subtitle.Text=t.subtitle;keyBox.PlaceholderText=t.key launch.Text=busy and t.checking or (t.start.." →");mode.Text=AUTH.mode=="development" and t.dev or t.server status.Text=t[statusKey] or (busy and (language=="en" and "Contacting access service…" or "Проверяем доступ…") or "") keyLabel.Text=language=="en" and "ACCESS KEY" or "КЛЮЧ ДОСТУПА" languageLabel.Text=language=="en" and "INTERFACE LANGUAGE" or "ЯЗЫК ИНТЕРФЕЙСА" launch.BackgroundTransparency=busy and .35 or 0 status.TextColor3=statusKey~="" and Color3.fromRGB(255,165,155) or C.sub ru.BackgroundColor3=language=="ru" and C.accent:Lerp(C.panel,.65) or C.field en.BackgroundColor3=language=="en" and C.accent:Lerp(C.panel,.65) or C.field ruStroke.Transparency=language=="ru" and .3 or 1 enStroke.Transparency=language=="en" and .3 or 1 ru.TextColor3=language=="ru" and C.text or C.sub en.TextColor3=language=="en" and C.text or C.sub end local close close=function() if closed then return end closed=true;attempt+=1;keyBox.Text="" for _,link in ipairs(links)do link:Disconnect()end gui:Destroy() if env.CleanClient_LoginClose==close then env.CleanClient_LoginClose=nil end end env.CleanClient_LoginClose=close local function listen(event,fn)links[#links+1]=event:Connect(fn)end local tweens=game:GetService("TweenService") listen(keyBox.Focused,function()tweens:Create(inputStroke,TweenInfo.new(.15),{Transparency=.12}):Play()end) listen(keyBox.FocusLost,function()tweens:Create(inputStroke,TweenInfo.new(.15),{Transparency=.75}):Play()end) listen(cancel.Activated,close) listen(ru.Activated,function()if not busy then language="ru";refresh()end end) listen(en.Activated,function()if not busy then language="en";refresh()end end) local function submit() if closed or busy then return end if os.clock()256 then statusKey="empty";refresh();return end busy=true;attempt+=1;local ticket=attempt;statusKey="";refresh() task.delay(AUTH.timeout,function() if not closed and busy and attempt==ticket then attempt+=1;busy=false;nextTry=os.clock()+2;statusKey="timeout";refresh()end end) task.spawn(function() local ok,session,reason=pcall(verifyAccess,key,language) key=nil if closed or attempt~=ticket then return end busy=false if not ok or not session then nextTry=os.clock()+2;statusKey=ok and reason or "network";refresh();return end env.CleanClient_Language=language keyBox.Text="";close() local launched,err=pcall(startRemote,session,language) if not launched then if type(env.CleanClient_Unload)=="function" then pcall(env.CleanClient_Unload)end warn("[CleanClient] Client startup failed: "..tostring(err)) return end end) end listen(launch.Activated,submit) listen(keyBox.FocusLost,function(enter)if enter then submit()end end) refresh() end openAccessWindow()