local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))() local SCRIPT_URL = "https://api.jnkie.com/api/v1/luascripts/public/8a88de89cc45cb855183c89250c87ead490cde7b3055ee13933d8d2ea3bfcf1f/download" local KEY_LINK = "https://jnkie.com/flow/1004aba7-26a8-4210-a613-55125a51e1fe" local KEY_FILE = "AnomalyLockdownKey.txt" local EnteredKey = "" local Loading = false local Loaded = false local function Trim(Text) return tostring(Text or "") :gsub("^%s+", "") :gsub("%s+$", "") end local function CanSave() return type(writefile) == "function" and type(readfile) == "function" end local function SaveKey(Key) if not CanSave() then return false end local Success = pcall(function() writefile(KEY_FILE, Trim(Key)) end) return Success end local function LoadSavedKey() if not CanSave() then return nil end if type(isfile) == "function" then local Exists = false pcall(function() Exists = isfile(KEY_FILE) end) if not Exists then return nil end end local Success, Result = pcall(function() return readfile(KEY_FILE) end) if not Success then return nil end Result = Trim(Result) if Result == "" then return nil end return Result end local function DeleteSavedKey() if type(delfile) ~= "function" then return end pcall(function() if type(isfile) ~= "function" or isfile(KEY_FILE) then delfile(KEY_FILE) end end) end local SavedKey = LoadSavedKey() if SavedKey then EnteredKey = SavedKey end local Window = Rayfield:CreateWindow({ Name = "Anomaly Lockdown", Icon = 0, LoadingTitle = "Anomaly Lockdown", LoadingSubtitle = "Key System", ShowText = "Anomaly Lockdown", Theme = "Default", ToggleUIKeybind = "K", DisableRayfieldPrompts = false, DisableBuildWarnings = false, ConfigurationSaving = { Enabled = false, FolderName = nil, FileName = "AnomalyLockdown" }, Discord = { Enabled = false, Invite = "", RememberJoins = false }, KeySystem = false }) local KeyTab = Window:CreateTab( "Key System", 4483362458 ) KeyTab:CreateSection( "Anomaly Lockdown" ) local StatusParagraph = KeyTab:CreateParagraph({ Title = "Key System", Content = SavedKey and "Saved key found. It will be checked automatically." or "Press Get Key, complete the steps, then paste your Junkie key below." }) local KeyInput = KeyTab:CreateInput({ Name = "Enter Key", CurrentValue = EnteredKey, PlaceholderText = "Paste your key here...", RemoveTextAfterFocusLost = false, Flag = "AnomalyKey", Callback = function(Value) EnteredKey = tostring(Value or "") end }) KeyTab:CreateButton({ Name = "Get Key", Callback = function() local Copied = false if type(setclipboard) == "function" then local Success = pcall(function() setclipboard(KEY_LINK) end) if Success then Copied = true end elseif type(toclipboard) == "function" then local Success = pcall(function() toclipboard(KEY_LINK) end) if Success then Copied = true end end if Copied then Rayfield:Notify({ Title = "Get Key", Content = "Key link copied to your clipboard.", Duration = 5 }) else Rayfield:Notify({ Title = "Get Key", Content = KEY_LINK, Duration = 10 }) end end }) local function VerifyKey(Key, Automatic) if Loading or Loaded then return false end Key = Trim(Key) if Key == "" then if not Automatic then Rayfield:Notify({ Title = "Missing Key", Content = "Paste your Junkie key first.", Duration = 5 }) end return false end Loading = true if Automatic then StatusParagraph:Set({ Title = "Key System", Content = "Checking saved key..." }) else Rayfield:Notify({ Title = "Verifying", Content = "Checking your key...", Duration = 3 }) end getgenv().SCRIPT_KEY = Key local Success, Result = pcall(function() local Source = game:HttpGet(SCRIPT_URL) if not Source or Source == "" then error("Junkie returned an empty script.") end local Function, CompileError = loadstring(Source) if not Function then error( CompileError or "Failed to compile script." ) end return Function() end) Loading = false if Success then Loaded = true EnteredKey = Key getgenv().SCRIPT_KEY = Key getgenv().ANOMALY_KEY_VERIFIED = true local Saved = SaveKey(Key) Rayfield:Notify({ Title = Automatic and "Saved Key Verified" or "Key Verified", Content = Saved and "Key saved. You won't need to paste it again until it expires." or "Script loaded. Your executor does not support local key saving.", Duration = 6 }) return true end getgenv().SCRIPT_KEY = nil getgenv().ANOMALY_KEY_VERIFIED = nil if Automatic then DeleteSavedKey() EnteredKey = "" pcall(function() KeyInput:Set("") end) StatusParagraph:Set({ Title = "Key Expired / Invalid", Content = "Your saved key no longer works. Press Get Key to get a new one." }) Rayfield:Notify({ Title = "Saved Key Expired", Content = "Get a new key and paste it below.", Duration = 6 }) else Rayfield:Notify({ Title = "Key Verification Failed", Content = tostring(Result), Duration = 8 }) end return false end KeyTab:CreateButton({ Name = "Verify Key", Callback = function() VerifyKey(EnteredKey, false) end }) KeyTab:CreateButton({ Name = "Clear Saved Key", Callback = function() DeleteSavedKey() EnteredKey = "" getgenv().SCRIPT_KEY = nil getgenv().ANOMALY_KEY_VERIFIED = nil pcall(function() KeyInput:Set("") end) StatusParagraph:Set({ Title = "Key System", Content = "Saved key cleared. Press Get Key to get another key." }) Rayfield:Notify({ Title = "Saved Key Cleared", Content = "Your locally saved key was removed.", Duration = 4 }) end }) if SavedKey then task.defer(function() task.wait(0.5) VerifyKey(SavedKey, true) end) else Rayfield:Notify({ Title = "Anomaly Lockdown", Content = "Get your key to continue.", Duration = 5 }) end