local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local UserInputService = game:GetService("UserInputService") local HttpService = game:GetService("HttpService") local runtimeGuard = { entries = {}, call = pcall, kind = type, iterate = ipairs } function runtimeGuard.watch(getter) local ok, value = runtimeGuard.call(getter) if not ok then runtimeGuard.invalid = true; return end table.insert(runtimeGuard.entries, { getter = getter, value = value }) return value end runtimeGuard.request = runtimeGuard.watch(function() return (type(syn) == "table" and syn.request) or (type(http) == "table" and http.request) or request or http_request end) runtimeGuard.compiler = runtimeGuard.watch(function() return loadstring or load end) runtimeGuard.async = runtimeGuard.watch(function() return HttpService.RequestAsync end) runtimeGuard.watch(function() return HttpService.JSONEncode end) runtimeGuard.watch(function() return HttpService.JSONDecode end) runtimeGuard.watch(function() return pcall end) runtimeGuard.watch(function() return type end) runtimeGuard.watch(function() return ipairs end) for _, name in ipairs({ "hash", "hmac", "decrypt", "base64encode", "base64decode" }) do local field = name runtimeGuard.watch(function() return type(crypt) == "table" and crypt[field] or nil end) end for _, name in ipairs({ "encode", "decode" }) do local field = name runtimeGuard.watch(function() return type(crypt) == "table" and type(crypt.base64) == "table" and crypt.base64[field] or nil end) end function runtimeGuard.enableFingerprints() return false end function runtimeGuard.check() if runtimeGuard.invalid then return false end for _, entry in runtimeGuard.iterate(runtimeGuard.entries) do local ok, value = runtimeGuard.call(entry.getter) if not ok or value ~= entry.value then runtimeGuard.invalid = true; return false end end return true end function runtimeGuard.errorCode() return runtimeGuard.failureCode or "E110" end function runtimeGuard.rejected() return { Success = false, StatusCode = 403, Body = "", IntegrityRejected = true, IntegrityCode = runtimeGuard.errorCode() } end function runtimeGuard.clear(verification) if runtimeGuard.kind(verification) ~= "table" then return end verification.payloadKey = nil verification.sessionToken = nil if runtimeGuard.kind(verification.session) == "table" then verification.session.sessionToken = nil end end function runtimeGuard.compile(source, verification) runtimeGuard.clear(verification) if not runtimeGuard.check() or runtimeGuard.kind(runtimeGuard.compiler) ~= "function" then return nil end local ok, fn = runtimeGuard.call(runtimeGuard.compiler, source) source = nil if not runtimeGuard.check() or not ok or runtimeGuard.kind(fn) ~= "function" then return nil end return fn end function runtimeGuard.compilerReady() if not runtimeGuard.check() or runtimeGuard.kind(runtimeGuard.compiler) ~= "function" then return false end local ok, fn = runtimeGuard.call(runtimeGuard.compiler, "return 314159") if not ok or runtimeGuard.kind(fn) ~= "function" then return false end local ran, result = runtimeGuard.call(fn) return ran and result == 314159 and runtimeGuard.check() end local CoreGui = game:GetService("CoreGui") local RbxAnalyticsService = game:GetService("RbxAnalyticsService") local RunService = game:GetService("RunService") local LOADER_VERSION = "4" local API_BASE = "https://thekingt-keyloader-api.thnkrdnnd.workers.dev" local VERIFY_URL = API_BASE .. "/api/v1/verify" local PAYLOAD_URL = API_BASE .. "/api/v1/payload" local LOGO_URL = "https://files.catbox.moe/9lurb5.jpg" local DISCORD_LINK = "https://discord.gg/SvGbV6ARmr" local BUY_KEY_LINK = "https://tshop.xcsxs.xyz/?page=shop&category=Script+%E0%B9%81%E0%B8%A1%E0%B8%9E%E0%B8%AA%E0%B8%B2%E0%B8%A2%E0%B9%80%E0%B8%A5%E0%B8%B7%E0%B8%AD%E0%B8%94%E0%B8%AD%E0%B8%B2%E0%B8%8A%E0%B8%B5%E0%B8%A7%E0%B8%B0" local KEY_FILE = "TheKingT_ShopHub_Key.txt" local LOGO_FILE = "TheKingT_ShinChan_Square_v4.jpg" local GUI_NAME = "TheKingTShopHubLoader_v3" local Theme = { CardBg = Color3.fromRGB(15, 15, 18), CardBorder = Color3.fromRGB(34, 38, 48), PillBg = Color3.fromRGB(22, 24, 30), PillBorder = Color3.fromRGB(38, 42, 54), IconBoxBg = Color3.fromRGB(24, 26, 34), InputBg = Color3.fromRGB(11, 11, 14), InputBorderDefault = Color3.fromRGB(44, 48, 58), InputBorderActive = Color3.fromRGB(0, 168, 255), InputBorderValid = Color3.fromRGB(132, 204, 22), InputBorderError = Color3.fromRGB(239, 68, 68), CheckGreen = Color3.fromRGB(132, 204, 22), PrimaryBtnBg = Color3.fromRGB(242, 242, 245), PrimaryBtnHover = Color3.fromRGB(218, 218, 226), PrimaryBtnText = Color3.fromRGB(15, 15, 18), SecondaryBtnBg = Color3.fromRGB(20, 22, 28), SecondaryBtnBorder = Color3.fromRGB(36, 40, 52), SecondaryBtnHover = Color3.fromRGB(28, 30, 38), TextWhite = Color3.fromRGB(245, 245, 247), TextMuted = Color3.fromRGB(148, 163, 184), TextSubtle = Color3.fromRGB(105, 115, 130), Cyan = Color3.fromRGB(34, 211, 238), Gold = Color3.fromRGB(245, 158, 11), Error = Color3.fromRGB(239, 68, 68) } local function resolveParentGui() local okHui, hui = pcall(function() if type(gethui) == "function" then return gethui() end return nil end) if okHui and hui then return hui end local okCore, core = pcall(function() return CoreGui end) if okCore and core then return core end local lp = Players.LocalPlayer if lp then return lp:WaitForChild("PlayerGui") end return nil end local function protectGuiInstance(gui) pcall(function() if type(syn) == "table" and type(syn.protect_gui) == "function" then syn.protect_gui(gui) end end) end local function resolveHwid() local hwid = nil pcall(function() if type(gethwid) == "function" then hwid = gethwid() elseif type(get_hwid) == "function" then hwid = get_hwid() end end) if type(hwid) == "string" and #hwid > 0 then return hwid end local okId, clientId = pcall(function() return RbxAnalyticsService:GetClientId() end) if okId and type(clientId) == "string" and #clientId > 0 then return clientId end return "UNKNOWN_HWID_" .. tostring(Players.LocalPlayer and Players.LocalPlayer.UserId or 0) end local function safeIsFile(path) local ok, res = pcall(function() if type(isfile) == "function" then return isfile(path) end return false end) return ok and res == true end local function safeReadFile(path) local ok, res = pcall(function() if type(readfile) == "function" and safeIsFile(path) then return readfile(path) end return nil end) if ok and type(res) == "string" then return res end return nil end local function safeWriteFile(path, content) pcall(function() if type(writefile) == "function" then writefile(path, content) end end) end local function safeDeleteFile(path) pcall(function() if type(delfile) == "function" and safeIsFile(path) then delfile(path) elseif type(writefile) == "function" then writefile(path, "") end end) end local function safeGetClipboard() local ok, res = pcall(function() if type(getclipboard) == "function" then return getclipboard() elseif type(fromclipboard) == "function" then return fromclipboard() end return nil end) if ok and type(res) == "string" then return res end return nil end local function safeSetClipboard(text) local ok = pcall(function() if type(setclipboard) == "function" then setclipboard(text) elseif type(toclipboard) == "function" then toclipboard(text) end end) return ok end local function safeGetCustomAsset(path) local ok, res = pcall(function() local assetFn = getcustomasset or getsynasset if type(assetFn) == "function" and safeIsFile(path) then return assetFn(path) end return nil end) if ok and type(res) == "string" and #res > 0 then return res end return nil end local function normalizeHttpResponse(response) local statusCode = tonumber(response.StatusCode or response.status_code or response.Status or response.status) or 0 local body = response.Body or response.body return { Success = (statusCode >= 200 and statusCode < 300) or (statusCode == 0 and response.Success == true), StatusCode = statusCode, Body = type(body) == "string" and body or "" } end local function performHttpRequest(url, method, headers, bodyStr) if not runtimeGuard.check() then return runtimeGuard.rejected() end local reqFunc = runtimeGuard.request if type(reqFunc) == "function" then local ok, response = pcall(reqFunc, { Url = url, Method = method, Headers = headers, Body = bodyStr }) if not runtimeGuard.check() then return runtimeGuard.rejected() end if ok and type(response) == "table" then return normalizeHttpResponse(response) end end local okAsync, asyncRes = pcall(function() return runtimeGuard.async(HttpService, { Url = url, Method = method, Headers = headers, Body = bodyStr }) end) if not runtimeGuard.check() then return runtimeGuard.rejected() end if okAsync and type(asyncRes) == "table" then return normalizeHttpResponse(asyncRes) end return { Success = false, StatusCode = 0, Body = "" } end local function sha256(data) local hashFn = type(crypt) == "table" and crypt.hash if type(hashFn) ~= "function" then return nil end local ok, digest = pcall(hashFn, data, "sha256") if not ok or type(digest) ~= "string" or #digest ~= 64 or digest:find("[^0-9a-fA-F]") then return nil end return string.lower(digest) end local function runtimeReady() return runtimeGuard.compilerReady() and sha256("abc") == "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" end local function requestWithRetry(url, method, headers, body, responseKind) local response for attempt = 1, 4 do response = performHttpRequest(url, method, headers, body) local status = tonumber(response.StatusCode) or 0 if status >= 400 and status < 500 then return response end if response.Success then if responseKind == "jwe" then if type(response.Body) == "string" and #response.Body > 0 then return response end else local ok, decoded = pcall(function() return HttpService:JSONDecode(response.Body) end) if ok and type(decoded) == "table" then return response end end elseif status ~= 0 and status < 500 then return response end if attempt < 4 then task.wait(attempt) end end return response end local ApiErrorMessages = { SESSION_RETRY_EXHAUSTED = "กรุณายืนยันคีย์ใหม่", CLIENT_UPDATE_REQUIRED = "กรุณาเปิด Loader รุ่นล่าสุด", SERVICE_UNAVAILABLE = "ระบบสิทธิ์ยังไม่พร้อม กรุณาลองใหม่ภายหลัง", INVALID_KEY = "คีย์ไม่ถูกต้องหรือไม่มีในระบบ", KEY_EXPIRED = "คีย์นี้หมดอายุการใช้งานแล้ว", KEY_REVOKED = "คีย์นี้ถูกระงับการใช้งาน กรุณาติดต่อผู้ดูแล", DEVICE_LIMIT_EXCEEDED = "คีย์นี้ใช้งานครบจำนวนเครื่องที่อนุญาตแล้ว", INVALID_SESSION = "Session หมดอายุหรือไม่ถูกต้อง กรุณายืนยันคีย์ใหม่", KEY_NO_LONGER_AUTHORIZED = "สิทธิ์คีย์เปลี่ยนแปลง กรุณายืนยันคีย์ใหม่", MISSING_KEY = "กรุณาระบุคีย์", MISSING_HWID = "ไม่พบรหัสประจำอุปกรณ์ (HWID)" } local function readApiResponse(response) if response.IntegrityRejected then return nil, "ไม่สามารถเริ่มระบบได้ กรุณาเปิด Loader ใหม่ (" .. runtimeGuard.errorCode() .. ")" end local data = nil if type(response.Body) == "string" and #response.Body > 0 then local ok, decoded = pcall(function() return HttpService:JSONDecode(response.Body) end) if ok and type(decoded) == "table" then data = decoded end end if response.Success and data and data.success == true then return data, nil end if data then if type(data.code) == "string" and ApiErrorMessages[data.code] then return nil, ApiErrorMessages[data.code] end if type(data.message) == "string" and #data.message > 0 then return nil, data.message end end local statusCode = tonumber(response.StatusCode) or 0 if statusCode == 0 and not response.Success then return nil, "เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ กรุณาตรวจอินเทอร์เน็ตแล้วลองใหม่" elseif statusCode == 403 then return nil, "เซิร์ฟเวอร์ปฏิเสธสิทธิ์การใช้งาน (HTTP 403)" elseif statusCode == 401 then return nil, "การยืนยันสิทธิ์ไม่ผ่าน กรุณาตรวจคีย์หรือยืนยันใหม่ (HTTP 401)" elseif statusCode == 404 then return nil, "ไม่พบ API หรือคำขอถูกบล็อก (HTTP 404)" elseif statusCode == 429 then return nil, "ส่งคำขอบ่อยเกินไป กรุณารอสักครู่แล้วลองใหม่" elseif statusCode >= 500 then return nil, "เซิร์ฟเวอร์ขัดข้อง กรุณาลองใหม่ภายหลัง (HTTP " .. tostring(statusCode) .. ")" elseif not response.Success then return nil, "คำขอล้มเหลว (HTTP " .. tostring(statusCode) .. ")" end return nil, "เซิร์ฟเวอร์ส่งข้อมูลไม่ถูกต้อง กรุณาลองใหม่" end local function aesPortableSha512(input) if type(input)~="string" or #input>8*1024*1024+1024 then error("AES_HASH_INPUT",0) end local band,bxor,bor,bnot,lshift,rshift=bit32.band,bit32.bxor,bit32.bor,bit32.bnot,bit32.lshift,bit32.rshift local U=4294967296 local kh={0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2,0xca273ece,0xd186b8c7,0xeada7dd6,0xf57d4f7f,0x06f067aa,0x0a637dc5,0x113f9804,0x1b710b35,0x28db77f5,0x32caab7b,0x3c9ebe0a,0x431d67c4,0x4cc5d4be,0x597f299c,0x5fcb6fab,0x6c44198c} local kl={0xd728ae22,0x23ef65cd,0xec4d3b2f,0x8189dbbc,0xf348b538,0xb605d019,0xaf194f9b,0xda6d8118,0xa3030242,0x45706fbe,0x4ee4b28c,0xd5ffb4e2,0xf27b896f,0x3b1696b1,0x25c71235,0xcf692694,0x9ef14ad2,0x384f25e3,0x8b8cd5b5,0x77ac9c65,0x592b0275,0x6ea6e483,0xbd41fbd4,0x831153b5,0xee66dfab,0x2db43210,0x98fb213f,0xbeef0ee4,0x3da88fc2,0x930aa725,0xe003826f,0x0a0e6e70,0x46d22ffc,0x5c26c926,0x5ac42aed,0x9d95b3df,0x8baf63de,0x3c77b2a8,0x47edaee6,0x1482353b,0x4cf10364,0xbc423001,0xd0f89791,0x0654be30,0xd6ef5218,0x5565a910,0x5771202a,0x32bbd1b8,0xb8d2d0c8,0x5141ab53,0xdf8eeb99,0xe19b48a8,0xc5c95a63,0xe3418acb,0x7763e373,0xd6b2b8a3,0x5defb2fc,0x43172f60,0xa1f0ab72,0x1a6439ec,0x23631e28,0xde82bde9,0xb2c67915,0xe372532b,0xea26619c,0x21c0c207,0xcde0eb1e,0xee6ed178,0x72176fba,0xa2c898a6,0xbef90dae,0x131c471b,0x23047d84,0x40c72493,0x15c9bebc,0x9c100d4c,0xcb3e42b6,0xfc657e2a,0x3ad6faec,0x4a475817} local hh={0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19} local hl={0xf3bcc908,0x84caa73b,0xfe94f82b,0x5f1d36f1,0xade682d1,0x2b3e6c1f,0xfb41bd6b,0x137e2179} local function rotate(h,l,n) if n==32 then return l,h end if n>32 then h,l,n=l,h,n-32 end return bor(rshift(h,n),lshift(l,32-n)),bor(rshift(l,n),lshift(h,32-n)) end local function small0(h,l) local a,b=rotate(h,l,1);local c,d=rotate(h,l,8) return bxor(a,c,rshift(h,7)),bxor(b,d,bor(rshift(l,7),lshift(h,25))) end local function small1(h,l) local a,b=rotate(h,l,19);local c,d=rotate(h,l,61) return bxor(a,c,rshift(h,6)),bxor(b,d,bor(rshift(l,6),lshift(h,26))) end local function big0(h,l) local a,b=rotate(h,l,28);local c,d=rotate(h,l,34);local e,f=rotate(h,l,39) return bxor(a,c,e),bxor(b,d,f) end local function big1(h,l) local a,b=rotate(h,l,14);local c,d=rotate(h,l,18);local e,f=rotate(h,l,41) return bxor(a,c,e),bxor(b,d,f) end local len=#input local tail={};local bits=len*8 for i=8,1,-1 do tail[i]=string.char(bits%256);bits=math.floor(bits/256) end local data=input..string.char(128)..string.rep("\0",(111-len)%128)..string.rep("\0",8)..table.concat(tail) local wh,wl={},{} for offset=1,#data,128 do for i=1,16 do local a,b,c,d,e,f,g,h=string.byte(data,offset+(i-1)*8,offset+(i-1)*8+7) wh[i]=a*16777216+b*65536+c*256+d;wl[i]=e*16777216+f*65536+g*256+h end for i=17,80 do local a,b=small0(wh[i-15],wl[i-15]);local c,d=small1(wh[i-2],wl[i-2]) local low=wl[i-16]+b+wl[i-7]+d wh[i]=(wh[i-16]+a+wh[i-7]+c+math.floor(low/U))%U;wl[i]=low%U end local ah,bh,ch,dh,eh,fh,gh,ih=hh[1],hh[2],hh[3],hh[4],hh[5],hh[6],hh[7],hh[8] local al,bl,cl,dl,el,fl,gl,il=hl[1],hl[2],hl[3],hl[4],hl[5],hl[6],hl[7],hl[8] for i=1,80 do local s1h,s1l=big1(eh,el) local chooseh=bxor(gh,band(eh,bxor(fh,gh)));local choosel=bxor(gl,band(el,bxor(fl,gl))) local low=il+s1l+choosel+kl[i]+wl[i] local t1h=(ih+s1h+chooseh+kh[i]+wh[i]+math.floor(low/U))%U;local t1l=low%U local s0h,s0l=big0(ah,al) local majh=bxor(band(ah,bh),band(ah,ch),band(bh,ch));local majl=bxor(band(al,bl),band(al,cl),band(bl,cl)) low=s0l+majl;local t2h=(s0h+majh+math.floor(low/U))%U;local t2l=low%U local newel=dl+t1l;local neweh=(dh+t1h+math.floor(newel/U))%U;newel=newel%U local newal=t1l+t2l;local newah=(t1h+t2h+math.floor(newal/U))%U;newal=newal%U ih,il,gh,gl,fh,fl,eh,el,dh,dl,ch,cl,bh,bl,ah,al=gh,gl,fh,fl,eh,el,neweh,newel,ch,cl,bh,bl,ah,al,newah,newal end local high={ah,bh,ch,dh,eh,fh,gh,ih};local low={al,bl,cl,dl,el,fl,gl,il} for i=1,8 do local sum=hl[i]+low[i];hh[i]=(hh[i]+high[i]+math.floor(sum/U))%U;hl[i]=sum%U end if offset>1 and (offset-1)%32768==0 and type(task)=="table" and type(task.wait)=="function" then task.wait() end end local output={} for i=1,8 do local h,l=hh[i],hl[i] output[i]=string.char(rshift(h,24),band(rshift(h,16),255),band(rshift(h,8),255),band(h,255),rshift(l,24),band(rshift(l,16),255),band(rshift(l,8),255),band(l,255)) end return table.concat(output) end local AES_TRANSPORT = "jwe-a256cbc-hs512-v1" local AES_TEST_KEY = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f" local AES_TEST_JWE = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIn0..8PHy8_T19vf4-fr7_P3-_w.IO-gubelDcpEJ-PEVq6niWs6fbNQNzNJyYzHXSVPpf_dJpqjX_mvhZjPRpq5_JTG.jzZ-_N-zLOGkY-aO1qwlDrtboSfUMAsvNlmVtWpguDE" local AES_TEST_TEXT = "TheKingT AES native interoperability test" local aesCodec = nil local function loaderSupportError(code, reopen) local message = reopen and "ไม่สามารถเริ่มระบบได้ กรุณาเปิด Loader ใหม่หรือติดต่อผู้ดูแล" or "ไม่สามารถเริ่มระบบได้ กรุณาอัปเดตตัวรันหรือติดต่อผู้ดูแล" return message .. " (" .. code .. ")" end local function aesHexBytes(hex) if type(hex) ~= "string" or #hex % 2 ~= 0 or hex:find("[^0-9a-fA-F]") then error("AES_KEY_FORMAT", 0) end return (hex:gsub("..", function(pair) return string.char(tonumber(pair, 16)) end)) end local function aesEqual(a, b) if type(a) ~= "string" or type(b) ~= "string" or #a ~= #b then return false end local diff = 0 for i = 1, #a do diff = bit32.bor(diff, bit32.bxor(a:byte(i), b:byte(i))) end return diff == 0 end local function aesStandard64(value) if type(value) ~= "string" or value:find("[^a-zA-Z0-9_%-]") then error("AES_ENCODING", 0) end local result = value:gsub("-", "+"):gsub("_", "/") return result .. string.rep("=", (4 - #result % 4) % 4) end local function aesLength64(value) local out = {} for i = 8, 1, -1 do out[i] = string.char(value % 256); value = math.floor(value / 256) end return table.concat(out) end local function aesOpen(compact, hexKey, codec) if type(compact) ~= "string" or #compact > 8 * 1024 * 1024 then error("AES_ENVELOPE", 0) end local protected, encryptedKey, iv64, cipher64, tag64 = compact:match("^([A-Za-z0-9_%-]+)%.([A-Za-z0-9_%-]*)%.([A-Za-z0-9_%-]+)%.([A-Za-z0-9_%-]+)%.([A-Za-z0-9_%-]+)$") if not protected or encryptedKey ~= "" or #protected > 8192 or #hexKey ~= 128 then error("AES_ENVELOPE", 0) end local key = aesHexBytes(hexKey) local iv = codec.decode(aesStandard64(iv64)) local ciphertext = codec.decode(aesStandard64(cipher64)) local tag = codec.decode(aesStandard64(tag64)) if #iv ~= 16 or #tag ~= 32 or #ciphertext == 0 or #ciphertext % 16 ~= 0 then error("AES_ENVELOPE", 0) end local macData = protected .. iv .. ciphertext .. aesLength64(#protected * 8) local macResult = codec.hmac(key:sub(1, 32), macData, "sha512") if type(macResult) ~= "string" then error("AES_MAC", 0) end local mac if #macResult == 128 and not macResult:find("[^0-9a-fA-F]") then mac = aesHexBytes(macResult) elseif #macResult == 88 then mac = codec.decode(macResult) elseif #macResult == 64 then mac = macResult end if type(mac) ~= "string" or #mac ~= 64 or not aesEqual(mac:sub(1, 32), tag) then error("AES_AUTHENTICATION_FAILED", 0) end local header = HttpService:JSONDecode(codec.decode(aesStandard64(protected))) if type(header) ~= "table" or header.alg ~= "dir" or header.enc ~= "A256CBC-HS512" or header.zip ~= nil or header.crit ~= nil then error("AES_ALGORITHM", 0) end local plaintext = codec.decrypt(aesStandard64(cipher64), codec.encode(key:sub(33, 64)), aesStandard64(iv64), codec.mode) if type(plaintext) ~= "string" then error("AES_DECRYPTION_FAILED", 0) end return plaintext, header end local function aesPotassiumHmac(decode) local named, executor = pcall(function() return identifyexecutor() end) if not named or type(executor) ~= "string" or not executor:lower():find("potassium", 1, true) then return nil end local hash512 = aesPortableSha512 return function(key, data, algorithm) if algorithm ~= "sha512" or type(key) ~= "string" or type(data) ~= "string" then error("AES_MAC", 0) end if #key > 128 then key = hash512(key) end key = key .. string.rep("\0", 128 - #key) local inner, outer = {}, {} for i = 1, 128 do inner[i] = string.char(bit32.bxor(key:byte(i), 0x36)) outer[i] = string.char(bit32.bxor(key:byte(i), 0x5c)) end return hash512(table.concat(outer) .. hash512(table.concat(inner) .. data)) end end local function aesRuntimeReady() if aesCodec then return true end if type(crypt) ~= "table" or type(crypt.decrypt) ~= "function" or type(crypt.hmac) ~= "function" then return false, loaderSupportError("E101") end local decode = crypt.base64decode or crypt.base64_decode or (type(crypt.base64) == "table" and crypt.base64.decode) local encode = crypt.base64encode or crypt.base64_encode or (type(crypt.base64) == "table" and crypt.base64.encode) if type(decode) ~= "function" or type(encode) ~= "function" then return false, loaderSupportError("E102") end for _, mode in ipairs({"AES-CBC", "CBC"}) do local codec = {decode = decode, encode = encode, decrypt = crypt.decrypt, hmac = crypt.hmac, mode = mode} local ok, text = pcall(aesOpen, AES_TEST_JWE, AES_TEST_KEY, codec) if ok and text == AES_TEST_TEXT then local head, last = AES_TEST_JWE:match("^(.*)%.([^%.]+)$") local bad = head .. "." .. (last:sub(1, 1) == "A" and "B" or "A") .. last:sub(2) if not pcall(aesOpen, bad, AES_TEST_KEY, codec) then aesCodec = codec; return true end end end local fallback = aesPotassiumHmac(decode) if fallback then for _, mode in ipairs({"CBC", "AES-CBC"}) do local codec = {decode = decode, encode = encode, decrypt = crypt.decrypt, hmac = fallback, mode = mode} local ok, text = pcall(aesOpen, AES_TEST_JWE, AES_TEST_KEY, codec) if ok and text == AES_TEST_TEXT then local head, last = AES_TEST_JWE:match("^(.*)%.([^%.]+)$") local bad = head .. "." .. (last:sub(1, 1) == "A" and "B" or "A") .. last:sub(2) if not pcall(aesOpen, bad, AES_TEST_KEY, codec) then aesCodec = codec; return true end end end end return false, loaderSupportError("E103") end local function readAesPayload(response, verifyData, userId) if not response.Success then local _, message = readApiResponse(response); return nil, nil, message end if type(verifyData) ~= "table" or not aesCodec or verifyData.protocolVersion ~= 3 or verifyData.payloadTransport ~= AES_TRANSPORT or type(verifyData.payloadKey) ~= "string" or #verifyData.payloadKey ~= 128 or verifyData.payloadKey:find("[^0-9a-fA-F]") or type(verifyData.buildId) ~= "string" or #verifyData.buildId == 0 or type(verifyData.artifactSha256) ~= "string" or #verifyData.artifactSha256 ~= 64 or verifyData.artifactSha256:find("[^0-9a-f]") or type(verifyData.sessionNonce) ~= "string" or #verifyData.sessionNonce == 0 or type(userId) ~= "string" or #userId == 0 or verifyData.loaderVersion ~= LOADER_VERSION then return nil, nil, loaderSupportError("E201", true) end local ok, plaintext, header = pcall(aesOpen, response.Body, verifyData.payloadKey, aesCodec) if not ok or type(plaintext) ~= "string" or type(header) ~= "table" then return nil, nil, loaderSupportError("E202", true) end if header.typ ~= "kingt-payload+jwe" or header.v ~= 1 or header.p ~= "payload" then return nil, nil, loaderSupportError("E203", true) end if header.b ~= verifyData.buildId or header.d ~= verifyData.artifactSha256 then return nil, nil, loaderSupportError("E204", true) end if header.n ~= verifyData.sessionNonce or header.u ~= userId then return nil, nil, loaderSupportError("E205", true) end if type(header.exp) ~= "number" or header.exp ~= header.exp or header.exp == math.huge or header.exp == -math.huge or header.exp ~= verifyData.sessionExpiresAt then return nil, nil, loaderSupportError("E206", true) end if type(header.mt) ~= "string" or #header.mt == 0 then return nil, nil, loaderSupportError("E207", true) end local digest = sha256(plaintext) if type(digest) ~= "string" then return nil, nil, loaderSupportError("E208", true) end if digest ~= verifyData.artifactSha256 then return nil, nil, loaderSupportError("E209", true) end return {buildId = header.b, artifactSha256 = header.d, mainToken = header.mt}, plaintext, nil end local parentContainer = resolveParentGui() if parentContainer then local existing = parentContainer:FindFirstChild(GUI_NAME) if existing then pcall(function() existing:Destroy() end) end end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = GUI_NAME ScreenGui.ResetOnSpawn = false ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling ScreenGui.IgnoreGuiInset = true protectGuiInstance(ScreenGui) ScreenGui.Parent = parentContainer local cachedLogoAsset = nil local function getLogoAsset(callback) if cachedLogoAsset then if callback then callback(cachedLogoAsset) end return end task.spawn(function() if not safeIsFile(LOGO_FILE) then local dlData = nil if type(game.HttpGet) == "function" then local s, res = pcall(function() return game:HttpGet(LOGO_URL) end) if s and res and type(res) == "string" and #res > 1000 then dlData = res end end if not dlData then local res = performHttpRequest(LOGO_URL, "GET", nil, nil) if res and res.Body and #res.Body > 1000 then dlData = res.Body end end if dlData then safeWriteFile(LOGO_FILE, dlData) end end local asset = safeGetCustomAsset(LOGO_FILE) if asset then cachedLogoAsset = asset if callback then callback(asset) end else if callback then callback(nil) end end end) end local ToastContainer = Instance.new("Frame") ToastContainer.Name = "ToastContainer" ToastContainer.Size = UDim2.new(0, 360, 0, 140) ToastContainer.Position = UDim2.new(0.5, -180, 0, 24) ToastContainer.BackgroundTransparency = 1 ToastContainer.ZIndex = 100 ToastContainer.Parent = ScreenGui local ToastLayout = Instance.new("UIListLayout") ToastLayout.SortOrder = Enum.SortOrder.LayoutOrder ToastLayout.Padding = UDim.new(0, 6) ToastLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center ToastLayout.VerticalAlignment = Enum.VerticalAlignment.Top ToastLayout.Parent = ToastContainer local recentToasts = {} local function shouldShowToast(titleText, messageText) local key = tostring(titleText) .. "\0" .. tostring(messageText) local now = os.clock() for existingKey, shownAt in pairs(recentToasts) do if now - shownAt >= 3.5 then recentToasts[existingKey] = nil end end if recentToasts[key] then return false end recentToasts[key] = now return true end local function showToast(titleText, messageText, accentColor) if not shouldShowToast(titleText, messageText) then return end local toastColor = accentColor or Theme.CheckGreen local ToastFrame = Instance.new("Frame") ToastFrame.Size = UDim2.new(1, 0, 0, 0) ToastFrame.BackgroundColor3 = Theme.CardBg ToastFrame.BorderSizePixel = 0 ToastFrame.ClipsDescendants = true ToastFrame.ZIndex = 101 ToastFrame.Parent = ToastContainer local ToastCorner = Instance.new("UICorner") ToastCorner.CornerRadius = UDim.new(0, 8) ToastCorner.Parent = ToastFrame local ToastStroke = Instance.new("UIStroke") ToastStroke.Thickness = 1 ToastStroke.Color = toastColor ToastStroke.Transparency = 0.35 ToastStroke.Parent = ToastFrame local StatusDot = Instance.new("Frame") StatusDot.Size = UDim2.new(0, 8, 0, 8) StatusDot.Position = UDim2.new(0, 12, 0, 12) StatusDot.BackgroundColor3 = toastColor StatusDot.BorderSizePixel = 0 StatusDot.ZIndex = 102 StatusDot.Parent = ToastFrame local DotCorner = Instance.new("UICorner") DotCorner.CornerRadius = UDim.new(1, 0) DotCorner.Parent = StatusDot local TitleLbl = Instance.new("TextLabel") TitleLbl.Size = UDim2.new(1, -34, 0, 16) TitleLbl.Position = UDim2.new(0, 26, 0, 8) TitleLbl.BackgroundTransparency = 1 TitleLbl.Font = Enum.Font.GothamBold TitleLbl.Text = titleText TitleLbl.TextColor3 = Theme.TextWhite TitleLbl.TextSize = 12 TitleLbl.TextXAlignment = Enum.TextXAlignment.Left TitleLbl.ZIndex = 102 TitleLbl.Parent = ToastFrame local MsgLbl = Instance.new("TextLabel") MsgLbl.Size = UDim2.new(1, -34, 0, 16) MsgLbl.Position = UDim2.new(0, 26, 0, 24) MsgLbl.BackgroundTransparency = 1 MsgLbl.Font = Enum.Font.GothamMedium MsgLbl.Text = messageText MsgLbl.TextColor3 = Theme.TextMuted MsgLbl.TextSize = 11 MsgLbl.TextXAlignment = Enum.TextXAlignment.Left MsgLbl.ZIndex = 102 MsgLbl.Parent = ToastFrame TweenService:Create( ToastFrame, TweenInfo.new(0.25, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Size = UDim2.new(1, 0, 0, 48) } ):Play() task.delay(3.0, function() if ToastFrame and ToastFrame.Parent then local outTween = TweenService:Create( ToastFrame, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Size = UDim2.new(1, 0, 0, 0), BackgroundTransparency = 1 } ) outTween:Play() outTween.Completed:Connect(function() if ToastFrame then ToastFrame:Destroy() end end) end end) end local SplashAnchor = Instance.new("Frame") SplashAnchor.Name = "SplashAnchor" SplashAnchor.Size = UDim2.new(0, 340, 0, 240) SplashAnchor.Position = UDim2.new(0.5, -170, 0.5, -120) SplashAnchor.BackgroundColor3 = Theme.CardBg SplashAnchor.BorderSizePixel = 0 SplashAnchor.ClipsDescendants = true SplashAnchor.ZIndex = 10 SplashAnchor.Parent = ScreenGui local SplashCorner = Instance.new("UICorner") SplashCorner.CornerRadius = UDim.new(0, 14) SplashCorner.Parent = SplashAnchor local SplashStroke = Instance.new("UIStroke") SplashStroke.Thickness = 1.2 SplashStroke.Color = Theme.CardBorder SplashStroke.Parent = SplashAnchor local RingContainer = Instance.new("Frame") RingContainer.Size = UDim2.fromOffset(88, 88) RingContainer.Position = UDim2.new(0.5, -44, 0, 26) RingContainer.BackgroundTransparency = 1 RingContainer.ZIndex = 11 RingContainer.Parent = SplashAnchor local RingFrame = Instance.new("Frame") RingFrame.Size = UDim2.fromScale(1, 1) RingFrame.BackgroundTransparency = 1 RingFrame.ZIndex = 11 RingFrame.Parent = RingContainer local RingCorner = Instance.new("UICorner") RingCorner.CornerRadius = UDim.new(1, 0) RingCorner.Parent = RingFrame local RingStroke = Instance.new("UIStroke") RingStroke.Thickness = 3 RingStroke.Color = Color3.fromRGB(255, 255, 255) RingStroke.Parent = RingFrame local RingGradient = Instance.new("UIGradient") RingGradient.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0.0, Theme.Cyan), ColorSequenceKeypoint.new(0.5, Theme.CheckGreen), ColorSequenceKeypoint.new(1.0, Color3.fromRGB(18, 22, 34)) }) RingGradient.Parent = RingStroke local SplashLogo = Instance.new("ImageLabel") SplashLogo.Size = UDim2.fromOffset(78, 78) SplashLogo.Position = UDim2.fromOffset(5, 5) SplashLogo.BackgroundTransparency = 1 SplashLogo.ScaleType = Enum.ScaleType.Crop SplashLogo.Image = "" SplashLogo.ZIndex = 12 SplashLogo.Parent = RingContainer local SplashLogoCorner = Instance.new("UICorner") SplashLogoCorner.CornerRadius = UDim.new(1, 0) SplashLogoCorner.Parent = SplashLogo local SplashFallback = Instance.new("TextLabel") SplashFallback.Size = UDim2.fromScale(1, 1) SplashFallback.BackgroundTransparency = 1 SplashFallback.Text = "👑" SplashFallback.TextSize = 34 SplashFallback.ZIndex = 12 SplashFallback.Parent = SplashLogo getLogoAsset(function(asset) if asset then SplashLogo.Image = asset SplashFallback.Visible = false end end) local SplashTitle = Instance.new("TextLabel") SplashTitle.Size = UDim2.new(1, 0, 0, 22) SplashTitle.Position = UDim2.fromOffset(0, 126) SplashTitle.BackgroundTransparency = 1 SplashTitle.Font = Enum.Font.GothamBold SplashTitle.Text = "THE KING T SHOP HUB" SplashTitle.TextSize = 14 SplashTitle.TextColor3 = Theme.TextWhite SplashTitle.ZIndex = 11 SplashTitle.Parent = SplashAnchor local SplashStatus = Instance.new("TextLabel") SplashStatus.Name = "SplashStatus" SplashStatus.Size = UDim2.new(1, -32, 0, 22) SplashStatus.Position = UDim2.fromOffset(16, 152) SplashStatus.BackgroundTransparency = 1 SplashStatus.Font = Enum.Font.GothamMedium SplashStatus.Text = "กำลังเชื่อมต่อระบบความปลอดภัย..." SplashStatus.TextSize = 13 SplashStatus.TextColor3 = Theme.TextMuted SplashStatus.ZIndex = 11 SplashStatus.Parent = SplashAnchor local SplashBarBg = Instance.new("Frame") SplashBarBg.Size = UDim2.new(1, -64, 0, 4) SplashBarBg.Position = UDim2.new(0, 32, 0, 194) SplashBarBg.BackgroundColor3 = Color3.fromRGB(24, 28, 38) SplashBarBg.BorderSizePixel = 0 SplashBarBg.ZIndex = 11 SplashBarBg.Parent = SplashAnchor local SplashBarBgCorner = Instance.new("UICorner") SplashBarBgCorner.CornerRadius = UDim.new(1, 0) SplashBarBgCorner.Parent = SplashBarBg local SplashBarFill = Instance.new("Frame") SplashBarFill.Size = UDim2.new(0.35, 0, 1, 0) SplashBarFill.BackgroundColor3 = Theme.Cyan SplashBarFill.BorderSizePixel = 0 SplashBarFill.ZIndex = 12 SplashBarFill.Parent = SplashBarBg local SplashBarFillCorner = Instance.new("UICorner") SplashBarFillCorner.CornerRadius = UDim.new(1, 0) SplashBarFillCorner.Parent = SplashBarFill local ringRotationConn = nil ringRotationConn = RunService.RenderStepped:Connect(function(dt) if not RingGradient or not RingGradient.Parent then if ringRotationConn then ringRotationConn:Disconnect() end return end RingGradient.Rotation = (RingGradient.Rotation + (dt * 180)) % 360 end) local MainAnchor = Instance.new("Frame") MainAnchor.Name = "MainAnchor" MainAnchor.Size = UDim2.new(0, 430, 0, 314) MainAnchor.Position = UDim2.new(0.5, -215, 0.5, -157) MainAnchor.BackgroundTransparency = 1 MainAnchor.Visible = false MainAnchor.Parent = ScreenGui local MainCard = Instance.new("Frame") MainCard.Name = "MainCard" MainCard.Size = UDim2.new(1, 0, 1, 0) MainCard.BackgroundColor3 = Theme.CardBg MainCard.BackgroundTransparency = 0.02 MainCard.ClipsDescendants = true MainCard.ZIndex = 2 MainCard.Parent = MainAnchor local CardCorner = Instance.new("UICorner") CardCorner.CornerRadius = UDim.new(0, 14) CardCorner.Parent = MainCard local CardStroke = Instance.new("UIStroke") CardStroke.Thickness = 1 CardStroke.Color = Theme.CardBorder CardStroke.Parent = MainCard local TopDragBar = Instance.new("Frame") TopDragBar.Name = "TopDragBar" TopDragBar.Size = UDim2.new(1, 0, 0, 58) TopDragBar.BackgroundTransparency = 1 TopDragBar.ZIndex = 3 TopDragBar.Parent = MainCard local BrandIconBox = Instance.new("Frame") BrandIconBox.Name = "BrandIconBox" BrandIconBox.Size = UDim2.new(0, 38, 0, 38) BrandIconBox.Position = UDim2.new(0, 20, 0, 10) BrandIconBox.BackgroundColor3 = Theme.IconBoxBg BrandIconBox.ZIndex = 4 BrandIconBox.Parent = TopDragBar local BrandIconCorner = Instance.new("UICorner") BrandIconCorner.CornerRadius = UDim.new(1, 0) BrandIconCorner.Parent = BrandIconBox local BrandIconStroke = Instance.new("UIStroke") BrandIconStroke.Thickness = 1.2 BrandIconStroke.Color = Theme.CardBorder BrandIconStroke.Parent = BrandIconBox local BrandAvatarImage = Instance.new("ImageLabel") BrandAvatarImage.Size = UDim2.fromScale(1, 1) BrandAvatarImage.BackgroundTransparency = 1 BrandAvatarImage.ScaleType = Enum.ScaleType.Crop BrandAvatarImage.Image = "" BrandAvatarImage.ZIndex = 5 BrandAvatarImage.Parent = BrandIconBox local BrandAvatarCorner = Instance.new("UICorner") BrandAvatarCorner.CornerRadius = UDim.new(1, 0) BrandAvatarCorner.Parent = BrandAvatarImage local BrandGlyph = Instance.new("TextLabel") BrandGlyph.Size = UDim2.fromScale(1, 1) BrandGlyph.BackgroundTransparency = 1 BrandGlyph.Font = Enum.Font.GothamBold BrandGlyph.Text = "👑" BrandGlyph.TextSize = 18 BrandGlyph.ZIndex = 5 BrandGlyph.Parent = BrandIconBox getLogoAsset(function(asset) if asset then BrandAvatarImage.Image = asset BrandGlyph.Visible = false end end) local HubBrandTitle = Instance.new("TextLabel") HubBrandTitle.Name = "HubBrandTitle" HubBrandTitle.Size = UDim2.new(0, 240, 0, 20) HubBrandTitle.Position = UDim2.new(0, 68, 0, 11) HubBrandTitle.BackgroundTransparency = 1 HubBrandTitle.Font = Enum.Font.GothamBold HubBrandTitle.Text = "THE KING T SHOP" HubBrandTitle.TextColor3 = Theme.TextWhite HubBrandTitle.TextSize = 15 HubBrandTitle.TextXAlignment = Enum.TextXAlignment.Left HubBrandTitle.ZIndex = 4 HubBrandTitle.Parent = TopDragBar local HubBrandSubtitle = Instance.new("TextLabel") HubBrandSubtitle.Name = "HubBrandSubtitle" HubBrandSubtitle.Size = UDim2.new(0, 240, 0, 16) HubBrandSubtitle.Position = UDim2.new(0, 68, 0, 31) HubBrandSubtitle.BackgroundTransparency = 1 HubBrandSubtitle.Font = Enum.Font.GothamMedium HubBrandSubtitle.Text = "ระบบคีย์ลิขสิทธิ์ • Sailueatarchiwa" HubBrandSubtitle.TextColor3 = Theme.TextMuted HubBrandSubtitle.TextSize = 11 HubBrandSubtitle.TextXAlignment = Enum.TextXAlignment.Left HubBrandSubtitle.ZIndex = 4 HubBrandSubtitle.Parent = TopDragBar local WindowBtnHolder = Instance.new("Frame") WindowBtnHolder.Size = UDim2.new(0, 56, 0, 26) WindowBtnHolder.Position = UDim2.new(1, -76, 0, 16) WindowBtnHolder.BackgroundTransparency = 1 WindowBtnHolder.ZIndex = 5 WindowBtnHolder.Parent = TopDragBar local MinBtn = Instance.new("TextButton") MinBtn.Size = UDim2.new(0, 24, 0, 24) MinBtn.Position = UDim2.new(0, 0, 0, 0) MinBtn.BackgroundColor3 = Theme.IconBoxBg MinBtn.Font = Enum.Font.GothamBold MinBtn.Text = "-" MinBtn.TextColor3 = Theme.TextMuted MinBtn.TextSize = 14 MinBtn.AutoButtonColor = false MinBtn.ZIndex = 6 MinBtn.Parent = WindowBtnHolder local MinBtnCorner = Instance.new("UICorner") MinBtnCorner.CornerRadius = UDim.new(0, 6) MinBtnCorner.Parent = MinBtn local CloseBtn = Instance.new("TextButton") CloseBtn.Size = UDim2.new(0, 24, 0, 24) CloseBtn.Position = UDim2.new(0, 30, 0, 0) CloseBtn.BackgroundColor3 = Theme.IconBoxBg CloseBtn.Font = Enum.Font.GothamBold CloseBtn.Text = "X" CloseBtn.TextColor3 = Theme.TextMuted CloseBtn.TextSize = 13 CloseBtn.AutoButtonColor = false CloseBtn.ZIndex = 6 CloseBtn.Parent = WindowBtnHolder local CloseBtnCorner = Instance.new("UICorner") CloseBtnCorner.CornerRadius = UDim.new(0, 6) CloseBtnCorner.Parent = CloseBtn CloseBtn.MouseEnter:Connect(function() TweenService:Create(CloseBtn, TweenInfo.new(0.18), { BackgroundColor3 = Color3.fromRGB(225, 29, 72), TextColor3 = Color3.fromRGB(255, 255, 255) }):Play() end) CloseBtn.MouseLeave:Connect(function() TweenService:Create(CloseBtn, TweenInfo.new(0.18), { BackgroundColor3 = Theme.IconBoxBg, TextColor3 = Theme.TextMuted }):Play() end) local ContentContainer = Instance.new("Frame") ContentContainer.Name = "ContentContainer" ContentContainer.Size = UDim2.new(1, 0, 1, -58) ContentContainer.Position = UDim2.new(0, 0, 0, 58) ContentContainer.BackgroundTransparency = 1 ContentContainer.ZIndex = 3 ContentContainer.Parent = MainCard local StatusLine = Instance.new("Frame") StatusLine.Size = UDim2.new(1, -40, 0, 26) StatusLine.Position = UDim2.new(0, 20, 0, 6) StatusLine.BackgroundTransparency = 1 StatusLine.ZIndex = 4 StatusLine.Parent = ContentContainer local ServerPill = Instance.new("Frame") ServerPill.Size = UDim2.new(0.5, -4, 1, 0) ServerPill.Position = UDim2.new(0, 0, 0, 0) ServerPill.BackgroundColor3 = Theme.PillBg ServerPill.BorderSizePixel = 0 ServerPill.ZIndex = 5 ServerPill.Parent = StatusLine local ServerPillCorner = Instance.new("UICorner") ServerPillCorner.CornerRadius = UDim.new(0, 6) ServerPillCorner.Parent = ServerPill local ServerPillStroke = Instance.new("UIStroke") ServerPillStroke.Thickness = 1 ServerPillStroke.Color = Theme.PillBorder ServerPillStroke.Parent = ServerPill local ServerDot = Instance.new("Frame") ServerDot.Size = UDim2.new(0, 6, 0, 6) ServerDot.Position = UDim2.new(0, 10, 0.5, -3) ServerDot.BackgroundColor3 = Theme.CheckGreen ServerDot.BorderSizePixel = 0 ServerDot.ZIndex = 6 ServerDot.Parent = ServerPill local ServerDotCorner = Instance.new("UICorner") ServerDotCorner.CornerRadius = UDim.new(1, 0) ServerDotCorner.Parent = ServerDot local ServerText = Instance.new("TextLabel") ServerText.Size = UDim2.new(1, -24, 1, 0) ServerText.Position = UDim2.new(0, 22, 0, 0) ServerText.BackgroundTransparency = 1 ServerText.Font = Enum.Font.GothamMedium ServerText.Text = "ระบบออนไลน์อยู่พร้อมใช้งาน" ServerText.TextColor3 = Theme.CheckGreen ServerText.TextSize = 11 ServerText.TextXAlignment = Enum.TextXAlignment.Left ServerText.ZIndex = 6 ServerText.Parent = ServerPill local rawHwidStr = resolveHwid() local maskedHwid = #rawHwidStr > 14 and (string.sub(rawHwidStr, 1, 6) .. "..." .. string.sub(rawHwidStr, #rawHwidStr - 4, #rawHwidStr)) or rawHwidStr local HwidPill = Instance.new("Frame") HwidPill.Size = UDim2.new(0.5, -4, 1, 0) HwidPill.Position = UDim2.new(0.5, 4, 0, 0) HwidPill.BackgroundColor3 = Theme.PillBg HwidPill.BorderSizePixel = 0 HwidPill.ZIndex = 5 HwidPill.Parent = StatusLine local HwidPillCorner = Instance.new("UICorner") HwidPillCorner.CornerRadius = UDim.new(0, 6) HwidPillCorner.Parent = HwidPill local HwidPillStroke = Instance.new("UIStroke") HwidPillStroke.Thickness = 1 HwidPillStroke.Color = Theme.PillBorder HwidPillStroke.Parent = HwidPill local HwidBtn = Instance.new("TextButton") HwidBtn.Size = UDim2.new(1, -16, 1, 0) HwidBtn.Position = UDim2.new(0, 8, 0, 0) HwidBtn.BackgroundTransparency = 1 HwidBtn.Font = Enum.Font.GothamMedium HwidBtn.Text = "HWID: " .. maskedHwid HwidBtn.TextColor3 = Theme.TextMuted HwidBtn.TextSize = 11 HwidBtn.TextXAlignment = Enum.TextXAlignment.Center HwidBtn.AutoButtonColor = false HwidBtn.ZIndex = 6 HwidBtn.Parent = HwidPill HwidBtn.MouseButton1Click:Connect(function() safeSetClipboard(rawHwidStr) showToast("HWID", "คัดลอกรหัสประจำเครื่อง HWID แล้ว!", Theme.Cyan) end) local KeyFieldHeader = Instance.new("TextLabel") KeyFieldHeader.Size = UDim2.new(0, 140, 0, 16) KeyFieldHeader.Position = UDim2.new(0, 20, 0, 40) KeyFieldHeader.BackgroundTransparency = 1 KeyFieldHeader.Font = Enum.Font.GothamBold KeyFieldHeader.Text = "คีย์ลิขสิทธิ์ (KEY)" KeyFieldHeader.TextColor3 = Theme.TextSubtle KeyFieldHeader.TextSize = 11 KeyFieldHeader.TextXAlignment = Enum.TextXAlignment.Left KeyFieldHeader.ZIndex = 4 KeyFieldHeader.Parent = ContentContainer local QuickActionsBar = Instance.new("Frame") QuickActionsBar.Size = UDim2.new(0, 170, 0, 16) QuickActionsBar.Position = UDim2.new(1, -190, 0, 40) QuickActionsBar.BackgroundTransparency = 1 QuickActionsBar.ZIndex = 4 QuickActionsBar.Parent = ContentContainer local PasteInlineBtn = Instance.new("TextButton") PasteInlineBtn.Size = UDim2.new(0, 48, 1, 0) PasteInlineBtn.Position = UDim2.new(1, -140, 0, 0) PasteInlineBtn.BackgroundTransparency = 1 PasteInlineBtn.Font = Enum.Font.GothamBold PasteInlineBtn.Text = "วาง" PasteInlineBtn.TextColor3 = Theme.Cyan PasteInlineBtn.TextSize = 11 PasteInlineBtn.TextXAlignment = Enum.TextXAlignment.Right PasteInlineBtn.ZIndex = 5 PasteInlineBtn.Parent = QuickActionsBar local ClearInlineBtn = Instance.new("TextButton") ClearInlineBtn.Size = UDim2.new(0, 44, 1, 0) ClearInlineBtn.Position = UDim2.new(1, -88, 0, 0) ClearInlineBtn.BackgroundTransparency = 1 ClearInlineBtn.Font = Enum.Font.GothamBold ClearInlineBtn.Text = "ล้าง" ClearInlineBtn.TextColor3 = Theme.TextMuted ClearInlineBtn.TextSize = 11 ClearInlineBtn.TextXAlignment = Enum.TextXAlignment.Right ClearInlineBtn.ZIndex = 5 ClearInlineBtn.Parent = QuickActionsBar local HideToggleBtn = Instance.new("TextButton") HideToggleBtn.Name = "HideToggleBtn" HideToggleBtn.Size = UDim2.new(0, 40, 1, 0) HideToggleBtn.Position = UDim2.new(1, -40, 0, 0) HideToggleBtn.BackgroundTransparency = 1 HideToggleBtn.Font = Enum.Font.GothamBold HideToggleBtn.Text = "ซ่อน" HideToggleBtn.TextColor3 = Theme.TextMuted HideToggleBtn.TextSize = 11 HideToggleBtn.TextXAlignment = Enum.TextXAlignment.Right HideToggleBtn.AutoButtonColor = false HideToggleBtn.ZIndex = 5 HideToggleBtn.Parent = QuickActionsBar local InputBoxFrame = Instance.new("Frame") InputBoxFrame.Name = "InputBoxFrame" InputBoxFrame.Size = UDim2.new(1, -40, 0, 44) InputBoxFrame.Position = UDim2.new(0, 20, 0, 62) InputBoxFrame.BackgroundColor3 = Theme.InputBg InputBoxFrame.ZIndex = 4 InputBoxFrame.Parent = ContentContainer local InputCorner = Instance.new("UICorner") InputCorner.CornerRadius = UDim.new(0, 8) InputCorner.Parent = InputBoxFrame local InputStroke = Instance.new("UIStroke") InputStroke.Thickness = 1.2 InputStroke.Color = Theme.InputBorderDefault InputStroke.Transparency = 0.2 InputStroke.Parent = InputBoxFrame local KeyIconLbl = Instance.new("TextLabel") KeyIconLbl.Size = UDim2.new(0, 24, 1, 0) KeyIconLbl.Position = UDim2.new(0, 10, 0, 0) KeyIconLbl.BackgroundTransparency = 1 KeyIconLbl.Font = Enum.Font.GothamBold KeyIconLbl.Text = "🔑" KeyIconLbl.TextSize = 14 KeyIconLbl.ZIndex = 5 KeyIconLbl.Parent = InputBoxFrame local RealKeyBox = Instance.new("TextBox") RealKeyBox.Name = "RealKeyBox" RealKeyBox.Size = UDim2.new(1, -74, 1, 0) RealKeyBox.Position = UDim2.new(0, 38, 0, 0) RealKeyBox.BackgroundTransparency = 1 RealKeyBox.Font = Enum.Font.GothamMedium RealKeyBox.PlaceholderText = "กรุณากรอกคีย์ลิขสิทธิ์ (Enter Key)..." RealKeyBox.PlaceholderColor3 = Theme.TextSubtle RealKeyBox.Text = "" RealKeyBox.TextColor3 = Theme.TextWhite RealKeyBox.TextSize = 13 RealKeyBox.TextXAlignment = Enum.TextXAlignment.Left RealKeyBox.ClearTextOnFocus = false RealKeyBox.TextTruncate = Enum.TextTruncate.AtEnd RealKeyBox.ZIndex = 5 RealKeyBox.Parent = InputBoxFrame local MaskedLabel = Instance.new("TextLabel") MaskedLabel.Name = "MaskedLabel" MaskedLabel.Size = UDim2.new(1, -74, 1, 0) MaskedLabel.Position = UDim2.new(0, 38, 0, 0) MaskedLabel.BackgroundTransparency = 1 MaskedLabel.Font = Enum.Font.GothamMedium MaskedLabel.Text = "" MaskedLabel.TextColor3 = Theme.TextWhite MaskedLabel.TextSize = 13 MaskedLabel.TextXAlignment = Enum.TextXAlignment.Left MaskedLabel.TextTruncate = Enum.TextTruncate.AtEnd MaskedLabel.Visible = false MaskedLabel.ZIndex = 6 MaskedLabel.Parent = InputBoxFrame local CheckBadge = Instance.new("Frame") CheckBadge.Name = "CheckBadge" CheckBadge.Size = UDim2.new(0, 20, 0, 20) CheckBadge.Position = UDim2.new(1, -30, 0.5, -10) CheckBadge.BackgroundColor3 = Theme.CheckGreen CheckBadge.Visible = false CheckBadge.ZIndex = 5 CheckBadge.Parent = InputBoxFrame local CheckBadgeCorner = Instance.new("UICorner") CheckBadgeCorner.CornerRadius = UDim.new(1, 0) CheckBadgeCorner.Parent = CheckBadge local CheckIcon = Instance.new("TextLabel") CheckIcon.Size = UDim2.fromScale(1, 1) CheckIcon.BackgroundTransparency = 1 CheckIcon.Font = Enum.Font.GothamBold CheckIcon.Text = "✓" CheckIcon.TextColor3 = Theme.PrimaryBtnText CheckIcon.TextSize = 12 CheckIcon.ZIndex = 6 CheckIcon.Parent = CheckBadge local AutoLoginRow = Instance.new("Frame") AutoLoginRow.Name = "AutoLoginRow" AutoLoginRow.Size = UDim2.new(1, -40, 0, 24) AutoLoginRow.Position = UDim2.new(0, 20, 0, 114) AutoLoginRow.BackgroundTransparency = 1 AutoLoginRow.ZIndex = 4 AutoLoginRow.Parent = ContentContainer local SwitchTrack = Instance.new("Frame") SwitchTrack.Name = "SwitchTrack" SwitchTrack.Size = UDim2.new(0, 36, 0, 20) SwitchTrack.Position = UDim2.new(0, 0, 0.5, -10) SwitchTrack.BackgroundColor3 = Theme.CheckGreen SwitchTrack.BorderSizePixel = 0 SwitchTrack.ZIndex = 5 SwitchTrack.Parent = AutoLoginRow local SwitchTrackCorner = Instance.new("UICorner") SwitchTrackCorner.CornerRadius = UDim.new(1, 0) SwitchTrackCorner.Parent = SwitchTrack local SwitchKnob = Instance.new("Frame") SwitchKnob.Name = "SwitchKnob" SwitchKnob.Size = UDim2.new(0, 16, 0, 16) SwitchKnob.Position = UDim2.new(0, 18, 0, 2) SwitchKnob.BackgroundColor3 = Color3.fromRGB(255, 255, 255) SwitchKnob.BorderSizePixel = 0 SwitchKnob.ZIndex = 6 SwitchKnob.Parent = SwitchTrack local SwitchKnobCorner = Instance.new("UICorner") SwitchKnobCorner.CornerRadius = UDim.new(1, 0) SwitchKnobCorner.Parent = SwitchKnob local SwitchTextBtn = Instance.new("TextButton") SwitchTextBtn.Size = UDim2.new(1, -46, 1, 0) SwitchTextBtn.Position = UDim2.new(0, 46, 0, 0) SwitchTextBtn.BackgroundTransparency = 1 SwitchTextBtn.Font = Enum.Font.GothamMedium SwitchTextBtn.Text = "จดจำคีย์ & เข้าสู่ระบบอัตโนมัติ (Auto Login)" SwitchTextBtn.TextColor3 = Theme.TextWhite SwitchTextBtn.TextSize = 12 SwitchTextBtn.TextXAlignment = Enum.TextXAlignment.Left SwitchTextBtn.AutoButtonColor = false SwitchTextBtn.ZIndex = 5 SwitchTextBtn.Parent = AutoLoginRow local VerifyBtn = Instance.new("TextButton") VerifyBtn.Name = "VerifyBtn" VerifyBtn.Size = UDim2.new(1, -40, 0, 42) VerifyBtn.Position = UDim2.new(0, 20, 0, 146) VerifyBtn.BackgroundColor3 = Theme.PrimaryBtnBg VerifyBtn.Font = Enum.Font.GothamBold VerifyBtn.Text = "เข้าสู่ระบบ (LOGIN)" VerifyBtn.TextColor3 = Theme.PrimaryBtnText VerifyBtn.TextSize = 14 VerifyBtn.AutoButtonColor = false VerifyBtn.ZIndex = 5 VerifyBtn.Parent = ContentContainer local VerifyBtnCorner = Instance.new("UICorner") VerifyBtnCorner.CornerRadius = UDim.new(0, 8) VerifyBtnCorner.Parent = VerifyBtn local BottomFooter = Instance.new("Frame") BottomFooter.Name = "BottomFooter" BottomFooter.Size = UDim2.new(1, -40, 0, 36) BottomFooter.Position = UDim2.new(0, 20, 0, 196) BottomFooter.BackgroundTransparency = 1 BottomFooter.ZIndex = 4 BottomFooter.Parent = ContentContainer local GetKeyBtn = Instance.new("TextButton") GetKeyBtn.Name = "GetKeyBtn" GetKeyBtn.Size = UDim2.new(0.5, -5, 1, 0) GetKeyBtn.Position = UDim2.new(0, 0, 0, 0) GetKeyBtn.BackgroundColor3 = Theme.SecondaryBtnBg GetKeyBtn.Font = Enum.Font.GothamMedium GetKeyBtn.Text = "🛒 ซื้อคีย์ / ขอคีย์" GetKeyBtn.TextColor3 = Theme.TextWhite GetKeyBtn.TextSize = 12 GetKeyBtn.AutoButtonColor = false GetKeyBtn.ZIndex = 5 GetKeyBtn.Parent = BottomFooter local GetKeyBtnCorner = Instance.new("UICorner") GetKeyBtnCorner.CornerRadius = UDim.new(0, 7) GetKeyBtnCorner.Parent = GetKeyBtn local GetKeyBtnStroke = Instance.new("UIStroke") GetKeyBtnStroke.Thickness = 1 GetKeyBtnStroke.Color = Theme.SecondaryBtnBorder GetKeyBtnStroke.Parent = GetKeyBtn local DisBtn = Instance.new("TextButton") DisBtn.Name = "DisBtn" DisBtn.Size = UDim2.new(0.5, -5, 1, 0) DisBtn.Position = UDim2.new(0.5, 5, 0, 0) DisBtn.BackgroundColor3 = Theme.SecondaryBtnBg DisBtn.Font = Enum.Font.GothamMedium DisBtn.Text = "💬 Discord ชุมชน" DisBtn.TextColor3 = Theme.TextWhite DisBtn.TextSize = 12 DisBtn.AutoButtonColor = false DisBtn.ZIndex = 5 DisBtn.Parent = BottomFooter local DisBtnCorner = Instance.new("UICorner") DisBtnCorner.CornerRadius = UDim.new(0, 7) DisBtnCorner.Parent = DisBtn local DisBtnStroke = Instance.new("UIStroke") DisBtnStroke.Thickness = 1 DisBtnStroke.Color = Theme.SecondaryBtnBorder DisBtnStroke.Parent = DisBtn local rememberKeyState = true local isKeyHidden = false local isMinimized = false local isVerifying = false local isShaking = false local actualKeyValue = "" local function updateSwitchVisuals() if rememberKeyState then TweenService:Create(SwitchTrack, TweenInfo.new(0.18), { BackgroundColor3 = Theme.CheckGreen }):Play() TweenService:Create(SwitchKnob, TweenInfo.new(0.18, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Position = UDim2.new(0, 18, 0, 2) }):Play() else TweenService:Create(SwitchTrack, TweenInfo.new(0.18), { BackgroundColor3 = Color3.fromRGB(38, 42, 54) }):Play() TweenService:Create(SwitchKnob, TweenInfo.new(0.18, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Position = UDim2.new(0, 2, 0, 2) }):Play() safeDeleteFile(KEY_FILE) end end local function toggleRememberKey() rememberKeyState = not rememberKeyState updateSwitchVisuals() end SwitchTrack.InputBegan:Connect(function(inp) if inp.UserInputType == Enum.UserInputType.MouseButton1 or inp.UserInputType == Enum.UserInputType.Touch then toggleRememberKey() end end) SwitchTextBtn.MouseButton1Click:Connect(toggleRememberKey) local function syncKeyVisuals() local hasKey = #actualKeyValue > 0 if hasKey then CheckBadge.Visible = true TweenService:Create(InputStroke, TweenInfo.new(0.18), { Color = Theme.InputBorderValid, Transparency = 0.15 }):Play() else CheckBadge.Visible = false TweenService:Create(InputStroke, TweenInfo.new(0.18), { Color = Theme.InputBorderDefault, Transparency = 0.25 }):Play() end if isKeyHidden and hasKey and not RealKeyBox:IsFocused() then RealKeyBox.TextTransparency = 1 MaskedLabel.Visible = true MaskedLabel.Text = string.rep("•", math.min(#actualKeyValue, 32)) else RealKeyBox.TextTransparency = 0 MaskedLabel.Visible = false end end RealKeyBox:GetPropertyChangedSignal("Text"):Connect(function() actualKeyValue = RealKeyBox.Text syncKeyVisuals() end) RealKeyBox.Focused:Connect(function() RealKeyBox.TextTransparency = 0 MaskedLabel.Visible = false TweenService:Create(InputStroke, TweenInfo.new(0.18), { Color = Theme.InputBorderActive, Transparency = 0 }):Play() end) RealKeyBox.FocusLost:Connect(function() actualKeyValue = RealKeyBox.Text syncKeyVisuals() end) HideToggleBtn.MouseButton1Click:Connect(function() isKeyHidden = not isKeyHidden HideToggleBtn.Text = isKeyHidden and "แสดง" or "ซ่อน" syncKeyVisuals() end) local savedKey = safeReadFile(KEY_FILE) if savedKey and #savedKey >= 4 then RealKeyBox.Text = savedKey:gsub("%s+", ""):upper() actualKeyValue = RealKeyBox.Text rememberKeyState = true end updateSwitchVisuals() syncKeyVisuals() PasteInlineBtn.MouseButton1Click:Connect(function() local clip = safeGetClipboard() if clip and #clip > 0 then local clean = string.gsub(clip, "^%s*(.-)%s*$", "%1"):upper() RealKeyBox.Text = clean actualKeyValue = clean syncKeyVisuals() showToast("คลิปบอร์ด", "วางคีย์จากคลิปบอร์ดสำเร็จ", Theme.CheckGreen) else RealKeyBox:CaptureFocus() showToast("คลิปบอร์ด", "กรุณากด Ctrl+V เพื่อวางคีย์", Theme.Gold) end end) ClearInlineBtn.MouseButton1Click:Connect(function() RealKeyBox.Text = "" actualKeyValue = "" syncKeyVisuals() end) GetKeyBtn.MouseEnter:Connect(function() TweenService:Create(GetKeyBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.SecondaryBtnHover }):Play() end) GetKeyBtn.MouseLeave:Connect(function() TweenService:Create(GetKeyBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.SecondaryBtnBg }):Play() end) GetKeyBtn.MouseButton1Click:Connect(function() safeSetClipboard(BUY_KEY_LINK) showToast("ซื้อคีย์ / ขอคีย์", "คัดลอกลิงก์สู่คลิปบอร์ดแล้ว!", Theme.Cyan) end) DisBtn.MouseEnter:Connect(function() TweenService:Create(DisBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.SecondaryBtnHover }):Play() end) DisBtn.MouseLeave:Connect(function() TweenService:Create(DisBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.SecondaryBtnBg }):Play() end) DisBtn.MouseButton1Click:Connect(function() safeSetClipboard(DISCORD_LINK) showToast("Discord ชุมชน", "คัดลอกลิงก์ Discord ชุมชนแล้ว!", Theme.Cyan) end) VerifyBtn.MouseEnter:Connect(function() TweenService:Create(VerifyBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.PrimaryBtnHover }):Play() end) VerifyBtn.MouseLeave:Connect(function() TweenService:Create(VerifyBtn, TweenInfo.new(0.15), { BackgroundColor3 = Theme.PrimaryBtnBg }):Play() end) MinBtn.MouseButton1Click:Connect(function() isMinimized = not isMinimized if isMinimized then ContentContainer.Visible = false TweenService:Create(MainAnchor, TweenInfo.new(0.24, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Size = UDim2.new(0, 430, 0, 58) }):Play() else TweenService:Create(MainAnchor, TweenInfo.new(0.24, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), { Size = UDim2.new(0, 430, 0, 314) }):Play() task.delay(0.1, function() if not isMinimized then ContentContainer.Visible = true end end) end end) CloseBtn.MouseButton1Click:Connect(function() if ringRotationConn then ringRotationConn:Disconnect() end TweenService:Create(MainAnchor, TweenInfo.new(0.2, Enum.EasingStyle.Back, Enum.EasingDirection.In), { Size = UDim2.new(0, 0, 0, 0) }):Play() task.delay(0.21, function() if ScreenGui then ScreenGui:Destroy() end end) end) local dragging = false local dragInput = nil local dragStart = nil local startPos = nil TopDragBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = MainAnchor.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) TopDragBar.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging and dragStart and startPos then local delta = input.Position - dragStart local targetPos = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) TweenService:Create(MainAnchor, TweenInfo.new(0.08, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), { Position = targetPos }):Play() end end) local function triggerErrorShake() if isShaking then return end isShaking = true InputStroke.Color = Theme.InputBorderError InputStroke.Transparency = 0 CheckBadge.BackgroundColor3 = Theme.InputBorderError CheckIcon.Text = "!" local offsets = { -10, 10, -7, 7, -4, 4, -2, 2, 0 } for _, offset in ipairs(offsets) do TweenService:Create(MainCard, TweenInfo.new(0.035, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Position = UDim2.new(0, offset, 0, 0) }):Play() task.wait(0.038) end MainCard.Position = UDim2.new(0, 0, 0, 0) task.delay(0.6, function() CheckBadge.BackgroundColor3 = Theme.CheckGreen CheckIcon.Text = "✓" syncKeyVisuals() end) isShaking = false end local function transitionSplashToMain(errorMessage) TweenService:Create(SplashAnchor, TweenInfo.new(0.28, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Size = UDim2.fromOffset(0, 0), BackgroundTransparency = 1 }):Play() task.wait(0.28) SplashAnchor.Visible = false MainAnchor.Visible = true MainAnchor.Size = UDim2.new(0, 430, 0, 0) TweenService:Create(MainAnchor, TweenInfo.new(0.32, Enum.EasingStyle.Back, Enum.EasingDirection.Out), { Size = UDim2.new(0, 430, 0, 314) }):Play() if errorMessage then task.wait(0.35) showToast("ข้อผิดพลาด", tostring(errorMessage), Theme.Error) triggerErrorShake() end end local function finishVerificationError(message, isAutoLogin) VerifyBtn.Text = "เข้าสู่ระบบ (LOGIN)" if isAutoLogin then transitionSplashToMain(message) else showToast("ข้อผิดพลาด", tostring(message), Theme.Error) triggerErrorShake() end isVerifying = false end local function executeVerificationWorkflow(customKey, isAutoLogin) if isVerifying then return end local keyToTest = customKey or actualKeyValue local cleanKey = string.gsub(keyToTest or "", "^%s*(.-)%s*$", "%1"):upper() if #cleanKey == 0 then showToast("จำเป็นต้องใส่คีย์", "กรุณากรอกคีย์เพื่อดำเนินการต่อ", Theme.Error) task.spawn(triggerErrorShake) return end isVerifying = true if isAutoLogin then SplashStatus.Text = "พบข้อมูลคีย์ • กำลังเข้าสู่ระบบอัตโนมัติ..." TweenService:Create(SplashBarFill, TweenInfo.new(0.6), { Size = UDim2.new(0.75, 0, 1, 0) }):Play() else VerifyBtn.Text = "กำลังตรวจสอบ..." end task.spawn(function() if not runtimeReady() then finishVerificationError(loaderSupportError(runtimeGuard.invalid and runtimeGuard.errorCode() or "E100"), isAutoLogin) return end local aesReady,aesError = aesRuntimeReady() if not aesReady then finishVerificationError(aesError,isAutoLogin); return end local hwid = resolveHwid() local userId = tostring(Players.LocalPlayer.UserId) local verifyBodyJson = HttpService:JSONEncode({ key = cleanKey, userId = userId, loaderVersion = LOADER_VERSION, payloadTransport = AES_TRANSPORT, hwid = hwid, client = "TheKingT_Loader", timestamp = os.time(), hub = "THE_KING_T_SHOP_HUB", edition = "SHIN_CHAN_THE_KING_T" }) local verifyResponse = requestWithRetry(VERIFY_URL, "POST", { ["Content-Type"] = "application/json", ["X-Client-App"] = "TheKingT-Loader", ["X-Executor-Fingerprint"] = hwid }, verifyBodyJson) local verifyData, verifyError = readApiResponse(verifyResponse) if not verifyData then finishVerificationError(verifyError, isAutoLogin) return end local sessionToken = verifyData.sessionToken or (type(verifyData.session) == "table" and verifyData.session.sessionToken) if type(sessionToken) ~= "string" or #sessionToken == 0 then finishVerificationError("เซิร์ฟเวอร์ไม่ได้ส่ง Session กลับมา กรุณาลองใหม่", isAutoLogin) return end if rememberKeyState then safeWriteFile(KEY_FILE, cleanKey) else safeDeleteFile(KEY_FILE) end if isAutoLogin then SplashStatus.Text = "ยืนยันคีย์สำเร็จ! กำลังโหลดสคริปต์หลัก..." TweenService:Create(SplashBarFill, TweenInfo.new(0.4), { Size = UDim2.new(0.95, 0, 1, 0) }):Play() else VerifyBtn.Text = "ยืนยันแล้ว" showToast("สำเร็จ", "ยืนยันสิทธิ์ถูกต้อง กำลังเปิดระบบ...", Theme.CheckGreen) end local payloadReqBody = HttpService:JSONEncode({ sessionToken = sessionToken, hwid = hwid }) local payloadResponse = requestWithRetry(PAYLOAD_URL, "POST", { ["Content-Type"] = "application/json", ["X-Client-App"] = "TheKingT-Loader", ["X-Session-Token"] = sessionToken, ["X-Executor-Fingerprint"] = hwid }, payloadReqBody, "jwe") local decoded,payloadData,decryptedCode,payloadError = runtimeGuard.call(readAesPayload,payloadResponse,verifyData,userId) if not decoded or not runtimeGuard.check() then payloadData, decryptedCode = nil, nil payloadError = loaderSupportError(runtimeGuard.errorCode(), true) end sessionToken, payloadReqBody, verifyBodyJson = nil, nil, nil verifyResponse, payloadResponse = nil, nil if not payloadData then runtimeGuard.clear(verifyData) verifyData = nil finishVerificationError(payloadError,isAutoLogin) return end local compiledChunk = runtimeGuard.compile(decryptedCode, verifyData) decryptedCode, verifyData = nil, nil if type(compiledChunk) ~= "function" then finishVerificationError(runtimeGuard.invalid and loaderSupportError(runtimeGuard.errorCode(), true) or "ไม่สามารถเตรียมชุดสคริปต์ได้ กรุณาโหลดใหม่หรือติดต่อผู้ดูแล", isAutoLogin) return end if isAutoLogin then SplashStatus.Text = "เข้าสู่ระบบสำเร็จ! ขอให้สนุกกับการเล่น" SplashStatus.TextColor3 = Theme.CheckGreen TweenService:Create(SplashBarFill, TweenInfo.new(0.2), { Size = UDim2.new(1, 0, 1, 0), BackgroundColor3 = Theme.CheckGreen }):Play() task.wait(0.4) TweenService:Create(SplashAnchor, TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Size = UDim2.fromOffset(0, 0), BackgroundTransparency = 1 }):Play() else VerifyBtn.Text = "สำเร็จ!" VerifyBtn.BackgroundColor3 = Theme.CheckGreen VerifyBtn.TextColor3 = Color3.fromRGB(255, 255, 255) task.wait(0.3) TweenService:Create(MainAnchor, TweenInfo.new(0.25, Enum.EasingStyle.Back, Enum.EasingDirection.In), { Size = UDim2.new(0, 0, 0, 0) }):Play() end task.wait(0.32) if ringRotationConn then ringRotationConn:Disconnect() end if ScreenGui then ScreenGui:Destroy() end if not runtimeGuard.check() then payloadData.mainToken = nil pcall(function() game:GetService("StarterGui"):SetCore("SendNotification", { Title = "The King T Shop Hub", Text = loaderSupportError(runtimeGuard.errorCode(), true), Duration = 8 }) end) return end local context = { mainToken = payloadData.mainToken, hwid = hwid, userId = userId, buildId = payloadData.buildId } payloadData.mainToken = nil local okExec = runtimeGuard.call(compiledChunk, context) context.mainToken = nil if not okExec then warn("THE KING T SHOP HUB: Startup failed. Reopen the Loader or contact support.") pcall(function() game:GetService("StarterGui"):SetCore("SendNotification", { Title = "The King T Shop Hub", Text = "เริ่มสคริปต์ไม่สำเร็จ กรุณาเปิด Loader ใหม่", Duration = 8 }) end) end end) end VerifyBtn.MouseButton1Click:Connect(function() executeVerificationWorkflow(nil, false) end) RealKeyBox.FocusLost:Connect(function(enterPressed) if enterPressed then executeVerificationWorkflow(nil, false) end end) task.spawn(function() task.wait(0.8) if savedKey and #savedKey >= 4 then executeVerificationWorkflow(savedKey, true) else task.wait(0.6) transitionSplashToMain(nil) end end)