-- LocalScript local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") -- ========================= -- CONFIG BOTÃO -- ========================= local espAtivo = true local gui = Instance.new("ScreenGui") gui.Name = "ESP_TOGGLE_GUI" gui.ResetOnSpawn = false gui.Parent = PlayerGui local botao = Instance.new("TextButton") botao.Size = UDim2.new(0, 120, 0, 35) botao.Position = UDim2.new(0, 15, 0, 15) botao.BackgroundColor3 = Color3.fromRGB(180, 0, 0) botao.TextColor3 = Color3.fromRGB(255, 255, 255) botao.Text = "ESP: ON" botao.Font = Enum.Font.SourceSansBold botao.TextSize = 18 botao.Parent = gui botao.MouseButton1Click:Connect(function() espAtivo = not espAtivo if espAtivo then botao.Text = "ESP: ON" botao.BackgroundColor3 = Color3.fromRGB(180, 0, 0) else botao.Text = "ESP: OFF" botao.BackgroundColor3 = Color3.fromRGB(60, 60, 60) end end) -- ========================= -- ESP SYSTEM -- ========================= local highlights = {} local function criarESP(model) if highlights[model] then return end if not model:IsA("Model") then return end if not model:FindFirstChild("HumanoidRootPart") then return end local h = Instance.new("Highlight") h.Adornee = model h.FillColor = Color3.fromRGB(255, 0, 0) h.FillTransparency = 0.5 h.OutlineTransparency = 1 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.Parent = model highlights[model] = h end local function removerESP(model) if highlights[model] then highlights[model]:Destroy() highlights[model] = nil end end local function removerTodos() for model, h in pairs(highlights) do if h then h:Destroy() end end table.clear(highlights) end -- ========================= -- LOOP PRINCIPAL -- ========================= RunService.Heartbeat:Connect(function() if not espAtivo then removerTodos() return end for _, obj in ipairs(workspace:GetDescendants()) do if obj:IsA("Model") and obj ~= LocalPlayer.Character then local hrp = obj:FindFirstChild("HumanoidRootPart") local hum = obj:FindFirstChildOfClass("Humanoid") if hrp and hum and hum.Health > 0 then if hrp.AssemblyLinearVelocity.Magnitude > 0.1 then criarESP(obj) else removerESP(obj) end end end end end)