local frag = getgenv().fragESP local lib = getgenv().Library local holder = frag.holder local cam = workspace.CurrentCamera local function targets() local out = {} for _, p in ipairs(game:GetService("Players"):GetChildren()) do if p ~= game:GetService("Players").LocalPlayer then local r = p.Character and p.Character:FindFirstChild("HumanoidRootPart") if r then table.insert(out, {p = p, r = r, d = (r.Position - cam.CFrame.Position).Magnitude}) end end end table.sort(out, function(a, b) return a.d < b.d end) return out end lib.Registry["Max Distance"].Set(220) local t = targets() print("candidates:", #t) if t[1] then local r = t[1].r cam.CFrame = CFrame.new(r.Position + Vector3.new(0, 3, -13), r.Position) end task.wait(0.4) local t2 = targets() local target = t2[1] if not target then print("no target") return end local cf, sz = target.p.Character:GetBoundingBox() local hp = cam:WorldToScreenPoint(cf.Position + Vector3.yAxis * (sz.Y / 2)) local fp = cam:WorldToScreenPoint(cf.Position - Vector3.yAxis * (sz.Y / 2)) local wp = cam:WorldToScreenPoint(cf.Position + cam.CFrame.RightVector * (math.max(sz.X, sz.Z) * 0.5)) local expH = math.abs(fp.Y - hp.Y) local expW = math.abs(wp.X - (hp.X + fp.X) / 2) * 2 local drawn = {} for _, v in ipairs(holder:GetChildren()) do if v.Visible and v.Name == "LeftTop" then table.insert(drawn, string.format("top=%dx%d @%d,%d", v.Size.X.Offset, v.Size.Y.Offset, v.Position.X.Offset, v.Position.Y.Offset)) end end print("target:", target.p.Name, "dist:", math.floor(target.d)) print(string.format("expected box: w=%.0f h=%.0f", expW, expH)) print("drawn tops:", #drawn, table.concat(drawn, " | ")) print("hud W x H:", cam.ViewportSize.X, cam.ViewportSize.Y)