local _G_KEY = "ApexOutbreakESP" if getgenv()[_G_KEY] then getgenv()[_G_KEY]() getgenv()[_G_KEY] = nil task.wait() end local RunService = game:GetService("RunService") local Players = game:GetService("Players") local CoreGui = game:GetService("CoreGui") local UserInputService = game:GetService("UserInputService") local Workspace = game:GetService("Workspace") local Camera = Workspace.CurrentCamera local LocalPlayer = Players.LocalPlayer local NewInstance = Instance.new local NewVector2 = Vector2.new local NewColor3 = Color3.fromRGB local Floor = math.floor local FILL_COLOR = NewColor3(255, 153, 160) local OUTLINE_COLOR = NewColor3(220, 100, 110) local FILL_TRANSPARENCY = 0.8 local OUTLINE_TRANSPARENCY = 0.5 local TEXT_COLOR = NewColor3(255, 180, 185) local TEXT_OUTLINE_COLOR = NewColor3(0, 0, 0) local TEXT_SIZE = 14 local MAX_DIST = 500 local TOGGLE_KEY = Enum.KeyCode.F5 local ADORNEE_SCAN_INTERVAL = 0.25 local espEnabled = true local pool = {} local connections = {} local espRoot = NewInstance("Folder") espRoot.Name = _G_KEY espRoot.Parent = CoreGui local function getAIFolder() local world = Workspace:FindFirstChild("World") if not world then return nil end return world:FindFirstChild("AI") end local function getFastClusterFolder() local world = Workspace:FindFirstChild("World") if not world then return nil end local ignore = world:FindFirstChild("Ignore") if not ignore then return nil end return ignore:FindFirstChild("FastCluster") end local function refsModel(candidate, model) for _, descendant in candidate:GetDescendants() do if descendant:IsA("ObjectValue") and descendant.Name == "_REF" then local value = descendant.Value if value and (value == model or value:IsDescendantOf(model)) then return true end end end return false end local function getAdornee(model) local fastCluster = getFastClusterFolder() if fastCluster then for _, child in fastCluster:GetChildren() do if child:IsA("Model") and refsModel(child, model) then return child end end end return model end local function isDead(model) local hum = model:FindFirstChildOfClass("Humanoid") if hum and hum.Health <= 0 then return true end if model:GetAttribute("DeathAnimation") then return true end return false end local function makeHighlight(model) local h = NewInstance("Highlight") h.FillColor = FILL_COLOR h.OutlineColor = OUTLINE_COLOR h.FillTransparency = FILL_TRANSPARENCY h.OutlineTransparency = OUTLINE_TRANSPARENCY h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.Adornee = model h.Enabled = true h.Parent = espRoot return h end local function makeLabel() local t = Drawing.new("Text") t.Font = Drawing.Fonts.UI t.Size = TEXT_SIZE t.Color = TEXT_COLOR t.OutlineColor = TEXT_OUTLINE_COLOR t.Outline = true t.Center = true t.Visible = false return t end local function suppressGameHighlights(root, maid) local function handleChild(child) if child:IsA("Highlight") then child.Enabled = false child.FillTransparency = 1 child.OutlineTransparency = 1 table.insert(maid, child.Changed:Connect(function(prop) if prop == "Enabled" and child.Enabled then child.Enabled = false elseif prop == "FillTransparency" and child.FillTransparency < 1 then child.FillTransparency = 1 elseif prop == "OutlineTransparency" and child.OutlineTransparency < 1 then child.OutlineTransparency = 1 end end)) end end for _, child in root:GetDescendants() do handleChild(child) end table.insert(maid, root.DescendantAdded:Connect(function(child) task.defer(handleChild, child) end)) end local function updateAdornee(entry, now) if entry.nextAdorneeScan and now < entry.nextAdorneeScan then return end entry.nextAdorneeScan = now + ADORNEE_SCAN_INTERVAL local adornee = getAdornee(entry.model) if entry.adornee ~= adornee then entry.adornee = adornee entry.highlight.Adornee = adornee if not entry.suppressed[adornee] then entry.suppressed[adornee] = true suppressGameHighlights(adornee, entry.maid) end end end local function createEntry(model) local maid = {} local adornee = getAdornee(model) local entry = { model = model, adornee = adornee, label = makeLabel(), highlight = makeHighlight(adornee), maid = maid, suppressed = {}, nextAdorneeScan = 0, } entry.suppressed[model] = true suppressGameHighlights(model, maid) if adornee ~= model then entry.suppressed[adornee] = true suppressGameHighlights(adornee, maid) end return entry end local function destroyEntry(entry) for _, conn in entry.maid do conn:Disconnect() end table.clear(entry.maid) if entry.label then entry.label:Remove() entry.label = nil end if entry.highlight and entry.highlight.Parent then entry.highlight:Destroy() entry.highlight = nil end end local function refreshPool() local aiFolder = getAIFolder() if not aiFolder then return end for _, child in aiFolder:GetChildren() do if child:IsA("Model") and not pool[child] then pool[child] = createEntry(child) end end end connections[#connections + 1] = RunService.Heartbeat:Connect(function() local now = os.clock() local aiFolder = getAIFolder() if aiFolder then for _, child in aiFolder:GetChildren() do if child:IsA("Model") and not pool[child] then pool[child] = createEntry(child) end end end for model in pool do if not model or not model.Parent then destroyEntry(pool[model]) pool[model] = nil else updateAdornee(pool[model], now) end end end) connections[#connections + 1] = RunService.PreRender:Connect(function() local myChar = LocalPlayer.Character local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart") local myPos = myRoot and myRoot.Position or Vector3.zero for model, entry in pool do if not model or not model.Parent or not entry.highlight then continue end local head = model:FindFirstChild("Head") local dead = isDead(model) if not espEnabled or dead or not head then entry.label.Visible = false entry.highlight.Enabled = false continue end local dist = (head.Position - myPos).Magnitude if dist > MAX_DIST then entry.label.Visible = false entry.highlight.Enabled = false continue end local headTopWorld = head.Position + Vector3.new(0, head.Size.Y * 0.5 + 0.5, 0) local screenPos, onScreen = Camera:WorldToViewportPoint(headTopWorld) if not onScreen then entry.label.Visible = false entry.highlight.Enabled = false continue end entry.highlight.Enabled = true local label = entry.label label.Position = NewVector2(screenPos.X, screenPos.Y) label.Text = "Entity " .. Floor(dist) .. "m" label.Visible = true end end) connections[#connections + 1] = UserInputService.InputBegan:Connect(function(input, gpe) if gpe then return end if input.KeyCode == TOGGLE_KEY then espEnabled = not espEnabled if not espEnabled then for _, entry in pool do entry.label.Visible = false if entry.highlight then entry.highlight.Enabled = false end end end end end) getgenv()[_G_KEY] = function() for _, conn in connections do conn:Disconnect() end table.clear(connections) for _, entry in pool do destroyEntry(entry) end table.clear(pool) if espRoot and espRoot.Parent then espRoot:Destroy() end end refreshPool() print("[ApexESP] Loaded | Toggle: " .. TOGGLE_KEY.Name)