local P=game:GetService("Players") local W=game:GetService("Workspace") local U=game:GetService("UserInputService") local R=game:GetService("RunService") local C=game:GetService("CoreGui") local LP=P.LocalPlayer local CAM=workspace.CurrentCamera local AB=false local E1=false local E2=false local E3=false local H1=false local B1=false local H2=false local FN=20 local FF=400 local PN=320 local PF=160 local TC=false local CT=nil local CD=0 local CC=Color3.fromHSV(0,1,1) local FT=0.5 local OT=0.3 local SM=0.2 local PR=true local AE={} local PD={} -- ═══════════════════════════════════════════════════════ -- FAST SPAWN PIPELINE -- ═══════════════════════════════════════════════════════ local eQlist={} local eQset={} local eQscheduled=false local function gF(d) if d<=FN then return PN end if d>=FF then return PF end local t=(d-FN)/(FF-FN) t=t*t return PN+(PF-PN)*t end local DK={door=true,window=true,wall=true,floor=true,ceiling=true,prop=true,decoration=true,furniture=true,stairs=true,railing=true,pipe=true,vent=true,crate=true,barrel=true,container=true} local function hN(n) n=n:lower() for w in pairs(DK) do if string.find(n,w,1,true) then return true end end return false end local function iD(m) if hN(m.Name) then return true end local p=m.Parent local d=0 while p and d<4 do local n=p.Name if n=="activemap" or n=="map" or n=="decor" or n=="decorations" then return true end if hN(n) then return true end p=p.Parent d=d+1 end return false end local function iSB(m) if not m or m==LP.Character then return false end if not m:FindFirstChild("HumanoidRootPart") then return false end if P:GetPlayerFromCharacter(m) then return false end return true end local function iCM(m) if not m or m==LP.Character then return false end if P:GetPlayerFromCharacter(m) then return true end if iD(m) then return false end if m:FindFirstChild("Humanoid") then return true end local hH=m:FindFirstChild("Head")~=nil local hA=m:FindFirstChild("AnimationController")~=nil if (hH or hA) and (m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart) then return true end local n=m.Name:lower() if (string.find(n,"character",1,true) or string.find(n,"player",1,true) or string.find(n,"bot",1,true)) and (m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart) then return true end return false end local function gT(m) if not m or m==LP.Character then return nil end local pl=P:GetPlayerFromCharacter(m) if pl then return "player",pl end if iSB(m) then return "bot",m end if iCM(m) then return "custom",m end return nil end local function gN(m,t,r) if t=="player" and r then return r.Name end if t=="bot" and r then return r.Name or "Bot" end if t=="custom" and r then return r.Name or "Model" end return m.Name or "?" end local function gB(m) local p=m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart if p then return p end for _,c in ipairs(m:GetChildren()) do if c:IsA("BasePart") then return c end end return nil end local function cB(m,n) local p=gB(m) if not p then return nil end local bb=Instance.new("BillboardGui") bb.Size=UDim2.new(0,200,0,50) bb.StudsOffset=Vector3.new(0,3,0) bb.AlwaysOnTop=true bb.Parent=p local tl=Instance.new("TextLabel") tl.Size=UDim2.new(1,0,1,0) tl.BackgroundTransparency=1 tl.Text=n tl.TextColor3=Color3.new(1,1,1) tl.TextSize=10 tl.Font=Enum.Font.GothamBold tl.TextStrokeTransparency=0.5 tl.Parent=bb return bb end local function aE(m,t,r) if PD[m] or AE[m] then return end PD[m]=true task.spawn(function() local n=gN(m,t,r) if not m.Parent then PD[m]=nil return end local hl=Instance.new("Highlight") hl.FillColor=CC hl.OutlineColor=Color3.new(1,1,1) hl.FillTransparency=FT hl.OutlineTransparency=OT hl.Adornee=m hl.Parent=m local bb=cB(m,n) AE[m]={hl,bb} PD[m]=nil end) end local function rE(m) local d=AE[m] if d then if d[1] then d[1]:Destroy() end if d[2] then d[2]:Destroy() end AE[m]=nil end PD[m]=nil end local function cA() for m in pairs(AE) do rE(m) end end local function uC() for _,d in pairs(AE) do if d and d[1] then d[1].FillColor=CC d[1].FillTransparency=FT d[1].OutlineTransparency=OT end end end function pM(m) if not m or m==LP.Character then return end local t,r=gT(m) if not t then if AE[m] then rE(m) end return end local en=false if t=="player" and E1 then en=true elseif t=="bot" and E2 then en=true elseif t=="custom" and E3 then en=true end if not en then if AE[m] then rE(m) end return end local ex=AE[m] if ex then local hl,bb=ex[1],ex[2] local br=(not hl or not hl.Parent) if not br and bb then local p=bb.Parent if not p or not p:IsDescendantOf(m) then br=true end end if not br then return end rE(m) end aE(m,t,r) end -- ═══════════════════════════════════════════════════════ -- AIM CACHE (set-based for O(1)) -- ═══════════════════════════════════════════════════════ local CP={} local CB={} local CBset={} local CM={} local CMset={} local AR=false local function rP() local n={} for _,pl in ipairs(P:GetPlayers()) do if pl~=LP and pl.Character then local ch=pl.Character local rt=ch:FindFirstChild("HumanoidRootPart") if rt then local ap=rt if H1 then local hd=ch:FindFirstChild("Head") if hd then ap=hd end end n[#n+1]={aimPart=ap,type="player",ref=pl,model=ch} end end end CP=n end local function aSB(m) if not B1 then return end if not m or not m.Parent then return end local e=CBset[m] if e then if e.aimPart and e.aimPart.Parent then return end local root=m:FindFirstChild("HumanoidRootPart") if not root then return end local ap=root if H2 then local hd=m:FindFirstChild("Head") if hd and hd:IsA("BasePart") then ap=hd end end e.aimPart=ap return end if not iSB(m) then return end local root=m:FindFirstChild("HumanoidRootPart") if not root then return end local ap=root if H2 then local hd=m:FindFirstChild("Head") if hd and hd:IsA("BasePart") then ap=hd end end local entry={aimPart=ap,type="bot",ref=m,model=m} CB[#CB+1]=entry CBset[m]=entry end local function rSB(m) local e=CBset[m] if not e then return end CBset[m]=nil for i=1,#CB do if CB[i]==e then table.remove(CB,i) break end end end local function aCM(m) if not B1 or not E3 then return end if not m or not m.Parent then return end if P:GetPlayerFromCharacter(m) then return end local e=CMset[m] if e then if e.aimPart and e.aimPart.Parent then return end local root=m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart if not root then return end e.aimPart=root if H2 then local hd=m:FindFirstChild("Head") or m:FindFirstChild("head") if hd and hd:IsA("BasePart") then e.aimPart=hd end end return end if not iCM(m) then return end local root=m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart if not root then return end local ap=root if H2 then local hd=m:FindFirstChild("Head") or m:FindFirstChild("head") if hd and hd:IsA("BasePart") then ap=hd end end local entry={aimPart=ap,type="custom",ref=m,model=m} CM[#CM+1]=entry CMset[m]=entry end local function rCM(m) local e=CMset[m] if not e then return end CMset[m]=nil for i=1,#CM do if CM[i]==e then table.remove(CM,i) break end end end local function rA() if AR then return end AR=true task.spawn(function() rP() local nb={} local nbs={} if B1 then local l=W:GetDescendants() local b=120 for i=1,#l,b do local s=math.min(i+b-1,#l) for j=i,s do local o=l[j] if o:IsA("Model") and iSB(o) then local root=o:FindFirstChild("HumanoidRootPart") if root then local ap=root if H2 then local hd=o:FindFirstChild("Head") if hd and hd:IsA("BasePart") then ap=hd end end local entry={aimPart=ap,type="bot",ref=o,model=o} nb[#nb+1]=entry nbs[o]=entry end end end R.Heartbeat:Wait() end end CB=nb CBset=nbs local nc={} local ncs={} if B1 and E3 then local l=W:GetDescendants() local b=120 for i=1,#l,b do local s=math.min(i+b-1,#l) for j=i,s do local o=l[j] if o:IsA("Model") and not P:GetPlayerFromCharacter(o) and iCM(o) then local root=o:FindFirstChild("HumanoidRootPart") or o.PrimaryPart if root then local ap=root if H2 then local hd=o:FindFirstChild("Head") or o:FindFirstChild("head") if hd and hd:IsA("BasePart") then ap=hd end end local entry={aimPart=ap,type="custom",ref=o,model=o} nc[#nc+1]=entry ncs[o]=entry end end end R.Heartbeat:Wait() end end CM=nc CMset=ncs AR=false end) end -- ═══════════════════════════════════════════════════════ -- UNIFIED HANDLER: ESP + AIM в одном проходе -- ═══════════════════════════════════════════════════════ local function handleNew(o) if not o or not o.Parent then return end local m if o:IsA("Model") then m=o elseif o:IsA("Humanoid") or o:IsA("BasePart") then m=o.Parent if not m or not m:IsA("Model") then return end else return end if E1 or E2 or E3 then pM(m) end if B1 then aSB(m) aCM(m) end end local function eQ(o) if eQset[o] then return end eQset[o]=true eQlist[#eQlist+1]=o if eQscheduled then return end eQscheduled=true task.defer(function() eQscheduled=false local items=eQlist eQlist={} eQset={} for i=1,#items do handleNew(items[i]) end end) end local function sT() W.DescendantAdded:Connect(function(o) if not (E1 or E2 or E3 or B1) then return end local cn=o.ClassName if cn=="Model" or cn=="Humanoid" or cn=="BasePart" or cn=="MeshPart" then eQ(o) end end) W.DescendantRemoving:Connect(function(o) if o:IsA("Model") then if AE[o] then rE(o) end rSB(o) rCM(o) elseif o:IsA("Humanoid") then local m=o.Parent if m and m:IsA("Model") then if AE[m] then rE(m) end rSB(m) rCM(m) end end end) end local function sA() rP() P.PlayerAdded:Connect(function(pl) rP() pl.CharacterAdded:Connect(function(ch) rP() -- Instant process on character spawn task.defer(function() if ch and ch.Parent then if E1 or E2 or E3 then pM(ch) end end end) end) pl.CharacterRemoving:Connect(rP) end) P.PlayerRemoving:Connect(rP) for _,pl in ipairs(P:GetPlayers()) do pl.CharacterAdded:Connect(function(ch) rP() task.defer(function() if ch and ch.Parent then if E1 or E2 or E3 then pM(ch) end end end) end) pl.CharacterRemoving:Connect(rP) end end sA() -- ═══════════════════════════════════════════════════════ -- CATCH-UP SCAN (lightweight, every 0.35s) -- ═══════════════════════════════════════════════════════ local catchT=0 R.Heartbeat:Connect(function(dt) catchT=catchT+dt if catchT<0.35 then return end catchT=0 if not (E1 or E2 or E3 or B1) then return end -- Scan Workspace direct children only (fast) local ch=W:GetChildren() for i=1,#ch do local c=ch[i] if c:IsA("Model") and c:FindFirstChildOfClass("Humanoid") then if (E1 or E2 or E3) and not AE[c] and not PD[c] then pM(c) end if B1 then if not CBset[c] and not CMset[c] and not P:GetPlayerFromCharacter(c) then aSB(c) aCM(c) end end end end end) -- ═══════════════════════════════════════════════════════ -- ESP REFRESH (batched) -- ═══════════════════════════════════════════════════════ local FS=false local RQ=false local function rF() if not E1 and not E2 and not E3 then cA() return end if FS then RQ=true return end FS=true task.spawn(function() for _,pl in ipairs(P:GetPlayers()) do if pl~=LP and pl.Character then pM(pl.Character) end end local hs={} local ms={} for _,o in ipairs(W:GetDescendants()) do if o:IsA("Humanoid") then hs[#hs+1]=o elseif o:IsA("Model") then ms[#ms+1]=o end end local tot=#hs local i=1 while i<=tot do local s=math.min(i+59,tot) for j=i,s do local m=hs[j].Parent if m and m:IsA("Model") then pM(m) end end i=s+1 if i<=tot then R.Heartbeat:Wait() end end tot=#ms i=1 while i<=tot do local s=math.min(i+79,tot) for j=i,s do pM(ms[j]) end i=s+1 if i<=tot then R.Heartbeat:Wait() end end FS=false if RQ then RQ=false rF() end end) end -- ═══════════════════════════════════════════════════════ -- AIM TARGETING -- ═══════════════════════════════════════════════════════ local function gCT() local cl=nil local bs=math.huge local vp=CAM.ViewportSize local cx,cy=vp.X/2,vp.Y/2 local ch=LP.Character local rt=ch and ch:FindFirstChild("HumanoidRootPart") local pp=rt and rt.Position or CAM.CFrame.Position local tg={} for i=#CP,1,-1 do local t=CP[i] if not t.aimPart or not t.aimPart.Parent then table.remove(CP,i) else tg[#tg+1]=t end end if B1 then for m,e in pairs(CBset) do if not e.aimPart or not e.aimPart.Parent then rSB(m) else tg[#tg+1]=e end end if E3 then for m,e in pairs(CMset) do if not e.aimPart or not e.aimPart.Parent then rCM(m) else tg[#tg+1]=e end end end end for _,t in ipairs(tg) do local ap=t.aimPart local pos=ap.Position local sp,os=CAM:WorldToViewportPoint(pos) if os then local dx,dy=sp.X-cx,sp.Y-cy local ds=math.sqrt(dx*dx+dy*dy) local ddx,ddy,ddz=pp.X-pos.X,pp.Y-pos.Y,pp.Z-pos.Z local wd=math.sqrt(ddx*ddx+ddy*ddy+ddz*ddz) local ef=gF(wd) if ds<=ef then local sc=ds+wd*0.04 if sc0 and bp.Y>0 then local ox=(34-22)/2 local oy=(34-22)/2 CCB.Position=UDim2.new(0,bp.X-ox,0,bp.Y-oy) end end CBtn.MouseButton1Click:Connect(function() sCP() CCB.Visible=true MF.Visible=false end) CCB.MouseButton1Click:Connect(function() CCB.Visible=false MF.Visible=true end) MF:GetPropertyChangedSignal("Position"):Connect(function() if CCB.Visible then sCP() end end) MF.Visible=true CCB.Visible=false sT() rF()