--esp local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local LocalPlayer = Players.LocalPlayer local espEnabled = false local highlights = {} local function getHighlight(player) if highlights[player] then return highlights[player] end local h = Instance.new("Highlight") h.FillTransparency = 1 h.OutlineTransparency = 0 h.Parent = game.CoreGui highlights[player] = h return h end local function removeESP(player) if highlights[player] then highlights[player]:Destroy() highlights[player] = nil end end local function getHealthColor(hp) if hp <= 0 then return Color3.fromRGB(0, 0, 0) elseif hp <= 30 then return Color3.fromRGB(255, 0, 0) elseif hp <= 59 then return Color3.fromRGB(255, 255, 0) else return Color3.fromRGB(0, 255, 0) end end RunService.RenderStepped:Connect(function() for _, plr in ipairs(Players:GetPlayers()) do if plr ~= LocalPlayer then local h = getHighlight(plr) if espEnabled and plr.Character then local hum = plr.Character:FindFirstChild("Humanoid") if hum and hum.Health > 0 then h.Adornee = plr.Character h.OutlineColor = getHealthColor(hum.Health) h.Enabled = true else h.Enabled = false end else h.Enabled = false end end end end) Players.PlayerRemoving:Connect(removeESP) UIS.InputBegan:Connect(function(input) if UIS:GetFocusedTextBox() then return end if input.KeyCode == Enum.KeyCode.M then espEnabled = not espEnabled end end)