local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local espEnabled = true local espStorage = {} -- Stores highlights and UI for toggling local function createESP(player) if player == Players.LocalPlayer then return end -- Don't highlight yourself local function onCharAdded(char) local hum = char:WaitForChild("Humanoid") local head = char:WaitForChild("Head") -- 1. Create Highlight (The Glow) local highlight = Instance.new("Highlight") highlight.Name = "ESPHighlight" highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop highlight.FillColor = Color3.fromRGB(255, 0, 0) highlight.Enabled = espEnabled highlight.Parent = char -- 2. Create BillboardGui (The Text/Health) local bbg = Instance.new("BillboardGui") bbg.Name = "ESP_UI" bbg.Size = UDim2.new(4, 0, 1.5, 0) bbg.Adornee = head bbg.AlwaysOnTop = true bbg.ExtentsOffset = Vector3.new(0, 3, 0) -- Hover above head bbg.Enabled = espEnabled bbg.Parent = char local infoLabel = Instance.new("TextLabel") infoLabel.Size = UDim2.new(1, 0, 1, 0) infoLabel.BackgroundTransparency = 1 infoLabel.TextColor3 = Color3.new(1, 1, 1) infoLabel.TextStrokeTransparency = 0 infoLabel.TextScaled = true infoLabel.Font = Enum.Font.SourceSansBold infoLabel.Parent = bbg -- Update loop for Health local connection connection = hum.HealthChanged:Connect(function(health) if not char:IsDescendantOf(game) then connection:Disconnect() return end infoLabel.Text = string.format("%s\nHP: %d/%d", player.Name, health, hum.MaxHealth) end) infoLabel.Text = string.format("%s\nHP: %d/%d", player.Name, hum.Health, hum.MaxHealth) -- Store for toggling table.insert(espStorage, {highlight, bbg}) end player.CharacterAdded:Connect(onCharAdded) if player.Character then onCharAdded(player.Character) end end -- Setup for all players for _, player in ipairs(Players:GetPlayers()) do createESP(player) end Players.PlayerAdded:Connect(createESP) -- Toggle Logic (Press E) UserInputService.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == Enum.KeyCode.E then espEnabled = not espEnabled for _, items in ipairs(espStorage) do if items[1] then items[1].Enabled = espEnabled end if items[2] then items[2].Enabled = espEnabled end end end end)