-- // Services local RunService = game:GetService("RunService") local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local UserInputService = game:GetService("UserInputService") local Camera = Workspace.CurrentCamera -- // Player Variables local LocalPlayer = Players.LocalPlayer -- // Rayfield Setup local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() -- // --- Script Configuration & State Variables --- -- ESP Core local espEnabled = true local boxEspEnabled = true local skeletonEspEnabled = false -- local offScreenEspEnabled = false -- Removed local showZombieCounter = false -- Aimbot Core local aimbotEnabled = false local aimbotWallCheck = true local aimbotTargetBone = "Head" -- Aimbot Modes local leftClickAimbotEnabled = false -- Aimbot State local leftMouseDown = false local aimbotTarget = nil local zombieFolder = Workspace:FindFirstChild("Zombies") -- !!! CHANGE THIS IF THE ZOMBIE FOLDER PATH IS DIFFERENT !!! if not zombieFolder then warn("Korrupt Zombies | Germanized: Could not find the 'Zombies' folder in Workspace. ESP and Aimbot may not function.") zombieFolder = Workspace:FindFirstChild("Living") or Instance.new("Folder") zombieFolder.Name = "Zombies_NotFound"; zombieFolder.Parent = Workspace warn("Korrupt Zombies | Germanized: Using placeholder folder:", zombieFolder:GetFullName()) end -- Stores Drawing objects: { ZombieInstance = { Box=D, SkeletonLines={L1,L2,..} } } -- Removed OffScreen local activeEspDrawings = {} local zombieCounterLabel = nil -- Define bone pairs for Skeleton ESP local skeletonConnections = { {"Head", "UpperTorso"}, {"UpperTorso", "LowerTorso"}, {"LowerTorso", "HumanoidRootPart"}, {"UpperTorso", "LeftUpperArm"}, {"LeftUpperArm", "LeftLowerArm"}, {"LeftLowerArm", "LeftHand"}, {"UpperTorso", "RightUpperArm"}, {"RightUpperArm", "RightLowerArm"}, {"RightLowerArm", "RightHand"}, {"LowerTorso", "LeftUpperLeg"}, {"LeftUpperLeg", "LeftLowerLeg"}, {"LeftLowerLeg", "LeftFoot"}, {"LowerTorso", "RightUpperLeg"}, {"RightUpperLeg", "RightLowerLeg"}, {"RightLowerLeg", "RightFoot"}, {"Head", "Torso"}, {"Torso", "HumanoidRootPart"}, {"Torso", "Left Arm"}, {"Left Arm", "Left Leg"}, {"Torso", "Right Arm"},{"Right Arm", "Right Leg"}, } -- // --- Helper Functions --- local function GetPart(model, name) local part = model:FindFirstChild(name, true) if not part then for _, child in pairs(model:GetDescendants()) do if child:IsA("BasePart") and child.Name:lower() == name:lower() then return child end end end return part end -- // --- Core Functions (ESP, Aimbot Logic) --- local function GetZombies(includeDeadForCleanupCheck) local zombies = {} if zombieFolder and zombieFolder:IsA("Folder") then for _, potentialZombie in ipairs(zombieFolder:GetChildren()) do if potentialZombie:IsA("Model") then local humanoid = potentialZombie:FindFirstChildOfClass("Humanoid") local hrp = GetPart(potentialZombie, "HumanoidRootPart") or potentialZombie:FindFirstChildWhichIsA("BasePart") if humanoid and hrp then if humanoid.Health > 0 or (includeDeadForCleanupCheck and humanoid.Health <= 0) then -- Store extents size here once if needed for optimization, otherwise calculate in loop table.insert(zombies, {Instance = potentialZombie, Humanoid = humanoid, HRP = hrp}) end end end end end return zombies end local function UpdateEsp() local currentZombiesData = GetZombies(false) -- Get only alive zombies for drawing local zombiesProcessedThisFrame = {} local screenSize = Camera.ViewportSize -- Process ESP drawing only if master switch is on if espEnabled then for _, zombieData in ipairs(currentZombiesData) do local zombie = zombieData.Instance local humanoid = zombieData.Humanoid local hrp = zombieData.HRP table.insert(zombiesProcessedThisFrame, zombie) local hrpWorldPos = hrp.Position local hrpScreenPos, hrpOnScreen = Camera:WorldToScreenPoint(hrpWorldPos) -- Ensure ESP data structure exists if not activeEspDrawings[zombie] then activeEspDrawings[zombie] = { Box = nil, SkeletonLines = {} } -- Removed OffScreen end local espData = activeEspDrawings[zombie] --// Handle On-Screen ESP if hrpOnScreen then --// Box ESP Logic (Optimized & Position Fixed) if boxEspEnabled then -- Estimate size based on distance and model extents local modelSize = zombie:GetExtentsSize() -- Get rough model size local distance = hrpScreenPos.Z -- Use Z depth as distance measure local scaleFactor = math.clamp(70 / distance, 0.1, 10) -- Adjust base scale (70) and clamps as needed local boxWidth = modelSize.X * scaleFactor local boxHeight = modelSize.Y * scaleFactor if boxWidth > 1 and boxHeight > 1 then -- Basic validation if not espData.Box then pcall(function() espData.Box = Drawing.new("Quad"); espData.Box.Color=Color3.new(1,0,0); espData.Box.Thickness=1; espData.Box.Filled=false; espData.Box.ZIndex=10; espData.Box.Transparency=0.5; end) end if espData.Box then -- **FIX:** Anchor bottom edge to HRP screen position + small offset local centerX = hrpScreenPos.X local bottomY = hrpScreenPos.Y + 2 -- Anchor slightly below HRP Y (adjust '2' if needed) local topY = bottomY - boxHeight local pad = 1 espData.Box.PointA = Vector2.new(centerX - boxWidth/2 - pad, topY - pad) -- TopLeft espData.Box.PointB = Vector2.new(centerX + boxWidth/2 + pad, topY - pad) -- TopRight espData.Box.PointC = Vector2.new(centerX + boxWidth/2 + pad, bottomY + pad) -- BottomRight espData.Box.PointD = Vector2.new(centerX - boxWidth/2 - pad, bottomY + pad) -- BottomLeft espData.Box.Visible = true else -- Box creation failed or removed if espData.Box and espData.Box.Remove then pcall(espData.Box.Remove, espData.Box); espData.Box = nil end end else -- Calculated size is too small/invalid if espData.Box then espData.Box.Visible = false end end else -- Box ESP disabled if espData.Box then espData.Box.Visible = false end end --// Skeleton ESP Logic if skeletonEspEnabled then local lineIndex = 1 for _, connection in ipairs(skeletonConnections) do local part1 = GetPart(zombie, connection[1]) local part2 = GetPart(zombie, connection[2]) if part1 and part2 and part1:IsA("BasePart") and part2:IsA("BasePart") then local pos1, onScreen1 = Camera:WorldToScreenPoint(part1.Position) local pos2, onScreen2 = Camera:WorldToScreenPoint(part2.Position) if onScreen1 and onScreen2 then local line = espData.SkeletonLines[lineIndex] if not line then pcall(function() line = Drawing.new("Line"); line.Color=Color3.new(1,1,1); line.Thickness=1; line.ZIndex=9; line.Transparency=0.4; espData.SkeletonLines[lineIndex] = line end) end if line then line.From = Vector2.new(pos1.X, pos1.Y); line.To = Vector2.new(pos2.X, pos2.Y); line.Visible = true else if espData.SkeletonLines[lineIndex] and espData.SkeletonLines[lineIndex].Remove then pcall(espData.SkeletonLines[lineIndex].Remove, espData.SkeletonLines[lineIndex]); espData.SkeletonLines[lineIndex] = nil end end lineIndex = lineIndex + 1 else if espData.SkeletonLines[lineIndex] then espData.SkeletonLines[lineIndex].Visible = false end; lineIndex = lineIndex + 1 end else if espData.SkeletonLines[lineIndex] then espData.SkeletonLines[lineIndex].Visible = false end end end for i = lineIndex, #espData.SkeletonLines do if espData.SkeletonLines[i] then espData.SkeletonLines[i].Visible = false end end else for i = 1, #espData.SkeletonLines do if espData.SkeletonLines[i] then espData.SkeletonLines[i].Visible = false end end end --// Handle Off-Screen (Now just hides everything) else if espData.Box then espData.Box.Visible = false end for _, line in ipairs(espData.SkeletonLines or {}) do if line then line.Visible = false end end -- No offscreen indicator logic needed anymore end end -- End of zombie processing loop end -- End of if espEnabled --// Cleanup Logic (Runs every frame) for zombieInstance, espData in pairs(activeEspDrawings) do local zombieIsAliveAndValid = false local currentHumanoid = zombieInstance and zombieInstance:FindFirstChildOfClass("Humanoid") if currentHumanoid and currentHumanoid.Health > 0 then if zombieInstance.Parent then -- Simple check if it still exists in workspace zombieIsAliveAndValid = true end end -- Determine if drawings should be removed or hidden local shouldCleanupDrawings = not espEnabled or not zombieIsAliveAndValid local shouldHideBox = shouldCleanupDrawings or not boxEspEnabled local shouldHideSkeleton = shouldCleanupDrawings or not skeletonEspEnabled -- Apply cleanup/hiding if espData.Box then if shouldHideBox and espData.Box.Remove then pcall(espData.Box.Remove, espData.Box); espData.Box = nil elseif shouldHideBox then espData.Box.Visible = false end end if espData.SkeletonLines then local cleanupSkel = shouldHideSkeleton and #espData.SkeletonLines > 0 for i, line in ipairs(espData.SkeletonLines) do if line then if cleanupSkel and line.Remove then pcall(line.Remove, line); espData.SkeletonLines[i]=nil elseif shouldHideSkeleton then line.Visible = false end end end if cleanupSkel then espData.SkeletonLines = {} end end -- No OffScreen cleanup needed -- Remove the main entry if the zombie is definitely invalid if not zombieIsAliveAndValid then activeEspDrawings[zombieInstance] = nil end end --// Update Zombie Counter Label if zombieCounterLabel then if showZombieCounter then local aliveCount = #currentZombiesData -- Count from the list retrieved at the start zombieCounterLabel:Set("Zombies: " .. aliveCount) zombieCounterLabel.Visible = true else zombieCounterLabel.Visible = false end end end local function UpdateAimbot() local shouldRunAimbot = aimbotEnabled and leftClickAimbotEnabled and leftMouseDown if not shouldRunAimbot then aimbotTarget = nil; return end local playerPos = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") and LocalPlayer.Character.HumanoidRootPart.Position if not playerPos then return end local potentialTargetsData = GetZombies(false) local bestTargetPart = nil local closestToCrosshairDist = math.huge local mousePos = UserInputService:GetMouseLocation() for _, zombieData in ipairs(potentialTargetsData) do local zombie = zombieData.Instance local targetPart = GetPart(zombie, aimbotTargetBone) or zombieData.HRP if targetPart and targetPart:IsA("BasePart") then local targetPos = targetPart.Position local isVisible = true -- Assume target is visible initially if aimbotWallCheck then local rayOrigin = Camera.CFrame.Position -- Small adjustment: Use Magnitude once for efficiency if needed, otherwise keep as is for clarity. local offset = targetPos - rayOrigin local rayDir = offset.Unit * (offset.Magnitude * 1.05) -- Slight increase to ensure hit local rayParams = RaycastParams.new() rayParams.FilterType = Enum.RaycastFilterType.Exclude rayParams.FilterDescendantsInstances = {LocalPlayer.Character, zombie} -- Exclude player and the zombie itself rayParams.IgnoreWater = true local rayResult = Workspace:Raycast(rayOrigin, rayDir, rayParams) -- If the ray hits something, and that something is NOT part of the target zombie, then it's blocked if rayResult and rayResult.Instance and not rayResult.Instance:IsDescendantOf(zombie) then isVisible = false -- Target is not visible (blocked by a wall/object) end end -- Only proceed if the target is visible (either wall check is off, or it passed the check) if isVisible then local screenPos, onScreen = Camera:WorldToScreenPoint(targetPos) if onScreen then local crosshairDist = (Vector2.new(screenPos.X, screenPos.Y) - mousePos).Magnitude if crosshairDist < closestToCrosshairDist then closestToCrosshairDist = crosshairDist bestTargetPart = targetPart end end end -- If isVisible is false, the code above is skipped, achieving the same result as 'continue' end end -- End of the for loop -- Assign the best target found (if any) aimbotTarget = bestTargetPart -- If a target was found, update the camera CFrame within a task.spawn if aimbotTarget then -- Using task.spawn to avoid potential yielding issues if camera updates are restricted task.spawn(function() -- Check if aimbotTarget still exists before setting CFrame, avoids errors if target despawns between checks if aimbotTarget and aimbotTarget.Parent then pcall(function() -- Wrap in pcall for extra safety with camera manipulation Camera.CFrame = CFrame.new(Camera.CFrame.Position, aimbotTarget.Position) end) else aimbotTarget = nil -- Clear target if it became invalid end end) end end -- End of the UpdateAimbot function definition -- // --- User Input Handling for Left Click --- UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if gameProcessedEvent then return end; if input.UserInputType == Enum.UserInputType.MouseButton1 then leftMouseDown = true end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then leftMouseDown = false; if leftClickAimbotEnabled then aimbotTarget = nil end end end) -- // --- Rayfield Window Creation --- local Window = Rayfield:CreateWindow({ Name = "Korrupt Zombies | Germanized", Icon = "skull", LoadingTitle = "Korrupt Zombies Hacks", LoadingSubtitle = "by Germanized", Theme = "DarkBlue", ConfigurationSaving = { Enabled = true, FolderName = "GermanizedScripts", FileName = "KorruptZombiesConfig" }, Discord = { Enabled = false, Invite = "noinvitelink", RememberJoins = true }, KeySystem = false, KeySettings = { Title = "Key System (Disabled)", Subtitle = "Key System", Note = "Key system is not in use.", FileName = "KorruptZombiesKey", SaveKey = false, GrabKeyFromSite = false, Key = {""} } }) -- // --- Rayfield UI Elements --- local MainTab = Window:CreateTab("Main", "eye") local VisualsSection = MainTab:CreateSection("Visuals") local EspEnableToggle = MainTab:CreateToggle({ Name = "Enable ESP (Master)", CurrentValue = espEnabled, Flag = "EspMasterEnabled", Callback = function(Value) espEnabled = Value end, }) local BoxEspToggle = MainTab:CreateToggle({ Name = "Enable Overhead Box ESP (optimized for preformance )", CurrentValue = boxEspEnabled, Flag = "BoxESPEnabled", Callback = function(Value) boxEspEnabled = Value end, }) local SkeletonEspToggle = MainTab:CreateToggle({ Name = "Enable Skeleton ESP (PERFORMANCE HEAVY)", CurrentValue = skeletonEspEnabled, Flag = "SkeletonESPEnabled", Callback = function(Value) skeletonEspEnabled = Value end, }) -- Removed OffScreenEspToggle local ZombieCounterToggle = MainTab:CreateToggle({ Name = "Show Zombie Count", CurrentValue = showZombieCounter, Flag = "ShowZombieCount", Callback = function(Value) showZombieCounter = Value; if zombieCounterLabel then zombieCounterLabel.Visible = Value; if Value then zombieCounterLabel:Set("Zombies: " .. #GetZombies(false)) end end -- Update count on toggle end}) zombieCounterLabel = MainTab:CreateLabel("Zombies: 0"); zombieCounterLabel.Visible = showZombieCounter local CombatSection = MainTab:CreateSection("Combat") local AimbotEnableToggle = MainTab:CreateToggle({ Name = "Enable Aimbot (Master Switch)", CurrentValue = aimbotEnabled, Flag = "AimbotMasterEnabled", Callback = function(Value) aimbotEnabled = Value end}) MainTab:CreateParagraph({Title = "Aimbot Activation", Content = "Enable the toggle below to aim when holding Left Click."}) local LeftClickAimbotToggle = MainTab:CreateToggle({ Name = "Left Click Aimbot (Lock Camera)", CurrentValue = leftClickAimbotEnabled, Flag = "LeftClickAimbot", Callback = function(Value) leftClickAimbotEnabled = Value end}) MainTab:CreateDivider() MainTab:CreateParagraph({Title = "Aimbot Settings", Content = "Configure aimbot behavior."}) local AimbotWallCheckToggle = MainTab:CreateToggle({ Name = "Aimbot Wall Check (Line of Sight (lowkey dosnt work))", CurrentValue = aimbotWallCheck, Flag = "AimbotWallCheck", Callback = function(Value) aimbotWallCheck = Value end}) local aimbotTargetBoneOptions = {"Head", "HumanoidRootPart", "UpperTorso", "LowerTorso", "Torso"} local AimbotTargetDropdown = MainTab:CreateDropdown({ Name = "Aimbot Target Bone", Options = aimbotTargetBoneOptions, CurrentOption = {aimbotTargetBone}, MultipleOptions = false, Flag = "AimbotTargetBone", Callback = function(t) if t and #t > 0 then aimbotTargetBone = t[1] end end}) -- // --- Game Loop Connection --- local renderStepConnection = RunService.RenderStepped:Connect(function() local success, err = pcall(function() UpdateEsp(); UpdateAimbot() end) if not success then warn("Error in RenderStep:", err) end end) print("Korrupt Zombies | Germanized Script Loaded!") Rayfield:Notify({ Title = "Korrupt Zombies", Content = "Script by Germanized Loaded!", Duration = 5, Image = "loader-2" }) -- // --- Load Configuration --- Rayfield:LoadConfiguration() -- // --- Post-Load Initialization --- task.wait(0.2) pcall(function() espEnabled = EspEnableToggle.CurrentValue; boxEspEnabled = BoxEspToggle.CurrentValue; skeletonEspEnabled = SkeletonEspToggle.CurrentValue -- Removed offScreenEspEnabled sync showZombieCounter = ZombieCounterToggle.CurrentValue; aimbotEnabled = AimbotEnableToggle.CurrentValue; leftClickAimbotEnabled = LeftClickAimbotToggle.CurrentValue; aimbotWallCheck = AimbotWallCheckToggle.CurrentValue if AimbotTargetDropdown.CurrentOption and #AimbotTargetDropdown.CurrentOption > 0 then aimbotTargetBone = AimbotTargetDropdown.CurrentOption[1] end if zombieCounterLabel then zombieCounterLabel.Visible = showZombieCounter; if showZombieCounter then zombieCounterLabel:Set("Zombies: " .. #GetZombies(false)) end end print("Configuration loaded, script state synchronized.") end) -- // --- Cleanup --- local player = Players.LocalPlayer; local playerGui = player and player:FindFirstChildOfClass("PlayerGui") local function Cleanup() print("Korrupt Zombies | Germanized: Cleaning up..."); if renderStepConnection then renderStepConnection:Disconnect(); renderStepConnection = nil end for _, espData in pairs(activeEspDrawings) do if espData.Box and typeof(espData.Box.Remove) == "function" then pcall(espData.Box.Remove, espData.Box) end for _, line in ipairs(espData.SkeletonLines or {}) do if line and typeof(line.Remove)=="function" then pcall(line.Remove, line) end end -- No OffScreen cleanup needed end; activeEspDrawings = {} pcall(Rayfield.Destroy) end if player then player.Destroying:Connect(Cleanup) end; if playerGui then playerGui.Destroying:Connect(Cleanup) end