-- ===== USER EDIT HERE ===== local SCAN_FOLDERS = { workspace.Bases } local BOX_COLOR = Color3.fromRGB(255,0,0) local TEXT_COLOR = Color3.fromRGB(255,255,255) -- ===== SERVICES ===== local Players = game:GetService("Players") local RunService = game:GetService("RunService") local Camera = workspace.CurrentCamera local LocalPlayer = Players.LocalPlayer local ESP = {} -- ===== ROOT FINDER ===== local function getRoot(model) return model:FindFirstChild("HumanoidRootPart") or model:FindFirstChild("UpperTorso") or model:FindFirstChild("Torso") or model:FindFirstChildWhichIsA("BasePart") end -- ===== VALID MODEL ===== local function validModel(obj) if not obj:IsA("Model") then return false end if obj == LocalPlayer.Character then return false end return getRoot(obj) ~= nil end -- ===== ADD ESP ===== local function addESP(model) if ESP[model] then return end local box = Drawing.new("Square") box.Color = BOX_COLOR box.Thickness = 2 box.Filled = false local text = Drawing.new("Text") text.Size = 13 text.Center = true text.Outline = true text.Font = 2 text.Color = TEXT_COLOR ESP[model] = {Box = box, Text = text} -- cleanup model.AncestryChanged:Connect(function(_, parent) if not parent and ESP[model] then ESP[model].Box:Remove() ESP[model].Text:Remove() ESP[model] = nil end end) end -- ===== SCAN ===== local function scanFolder(folder) if not folder then return end for _, obj in ipairs(folder:GetDescendants()) do if validModel(obj) then addESP(obj) end end folder.DescendantAdded:Connect(function(obj) if validModel(obj) then task.wait(0.1) addESP(obj) end end) end for _, folder in ipairs(SCAN_FOLDERS) do scanFolder(folder) end -- ===== RENDER LOOP ===== RunService.RenderStepped:Connect(function() for model, draw in pairs(ESP) do local root = getRoot(model) if not root then draw.Box.Visible = false draw.Text.Visible = false continue end local pos, visible = Camera:WorldToViewportPoint(root.Position) if not visible then draw.Box.Visible = false draw.Text.Visible = false continue end local dist = (Camera.CFrame.Position - root.Position).Magnitude local scale = math.clamp(2800/dist, 16, 350) local size = Vector2.new(scale, scale*1.6) local boxPos = Vector2.new(pos.X-size.X/2, pos.Y-size.Y/2) -- BOX draw.Box.Size = size draw.Box.Position = boxPos draw.Box.Visible = true -- TEXT anchored to box draw.Text.Position = Vector2.new(pos.X, boxPos.Y - 14) draw.Text.Text = model.Name .. " [" .. math.floor(dist) .. "]" draw.Text.Visible = true end end)