--[[ Hp Team Pro V1 - Menu 3 tab (Main / Esp / Khác), phạm vi quét mặc định 150 studs Module: Maid, StateManager, TargetScanner, CombatEngine, EspEngine, MovementAndWorld, UIController Chạy lại script = tự dọn bản cũ rồi khởi động lại. ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local Lighting = game:GetService("Lighting") local Workspace = game:GetService("Workspace") local LocalPlayer = Players.LocalPlayer local genv = getgenv and getgenv() or _G local newcc = newcclosure or function(f) return f end local hasDrawing = pcall(function() return Drawing.new end) and Drawing ~= nil if genv.HpTeamProDestroy then pcall(genv.HpTeamProDestroy) end ------------------------------------------------------------------ Maid (chống rò rỉ kết nối) local Maid = {} Maid.__index = Maid function Maid.new() return setmetatable({ _t = {} }, Maid) end function Maid:Add(x) table.insert(self._t, x) return x end function Maid:Clean() local list = self._t self._t = {} for _, x in ipairs(list) do local t = typeof(x) if t == "RBXScriptConnection" then x:Disconnect() elseif t == "Instance" then pcall(function() x:Destroy() end) elseif t == "function" then pcall(x) elseif t == "thread" then pcall(task.cancel, x) else pcall(function() x:Remove() end) end -- Drawing object end end local G = Maid.new() -- maid toàn cục local function getChar() local c = LocalPlayer.Character if not c then return end local r = c:FindFirstChild("HumanoidRootPart") local h = c:FindFirstChildOfClass("Humanoid") if r and h and h.Health > 0 then return c, r, h end end ------------------------------------------------------------------ StateManager local State = { Toggles = {}, Handlers = {}, Listeners = {}, CfgListeners = {}, Snapshot = {}, Config = { ScanRange = 150, DroneHeightOffset = 15, FlySpeed = 60, WalkSpeed = 32, FlyDronHeight = 6, FlyStep = 20, AttackInterval = 0.1, }, } function State:On(n, f) self.Handlers[n] = f end function State:Get(n) return self.Toggles[n] == true end function State:Any(...) for _, n in ipairs({ ... }) do if self.Toggles[n] then return true end end return false end function State:Set(n, v) v = v and true or false if self:Get(n) == v then return end self.Toggles[n] = v local h = self.Handlers[n] if h then local ok, e = pcall(h, v) if not ok then warn("[HP] " .. n .. ": " .. tostring(e)) self.Toggles[n] = false -- lỗi thì tắt hẳn, không kẹt ON v = false end end for _, l in ipairs(self.Listeners) do pcall(l, n, v) end end function State:SetConfig(k, v) self.Config[k] = v for _, l in ipairs(self.CfgListeners) do pcall(l, k, v) end end ------------------------------------------------------------------ TargetScanner -- Cache Humanoid bằng DescendantAdded/Removing, mỗi 0.1s mới lọc theo khoảng cách (không quét workspace mỗi frame) local Scanner = { Models = {}, List = {}, Interval = 0.1, _acc = 0 } local SCAN_USERS = { "TeleDron", "TeleKill", "Aimbot", "AimMagic", "AutoShoot", "EspLine", "EspBox", "EspName", "EspDist", "EspHolo" } function Scanner.GetRoot(m) return m:FindFirstChild("HumanoidRootPart") or m.PrimaryPart end function Scanner.IsValid(m, origin) local hum = Scanner.Models[m] if not hum or not hum.Parent or hum.Health <= 0 then return false end if not m:IsDescendantOf(Workspace) then return false end if m == LocalPlayer.Character or Players:GetPlayerFromCharacter(m) then return false end -- bỏ mình + người chơi khác local r = Scanner.GetRoot(m) if not r then return false end return (r.Position - origin).Magnitude <= State.Config.ScanRange end local function registerHum(i) if i:IsA("Humanoid") and i.Parent and i.Parent:IsA("Model") then Scanner.Models[i.Parent] = i end end function Scanner.Init() G:Add(Workspace.DescendantAdded:Connect(registerHum)) G:Add(Workspace.DescendantRemoving:Connect(function(i) if i:IsA("Humanoid") then Scanner.Models[i.Parent] = nil end end)) task.spawn(function() local n = 0 for _, d in ipairs(Workspace:GetDescendants()) do registerHum(d) n += 1 if n % 2000 == 0 then task.wait() end -- yield để không đứng hình end end) G:Add(RunService.Heartbeat:Connect(function(dt) Scanner._acc += dt if Scanner._acc < Scanner.Interval then return end Scanner._acc = 0 if not State:Any(unpack(SCAN_USERS)) then if #Scanner.List > 0 then Scanner.List = {} end return end local _, root = getChar() if not root then Scanner.List = {} return end local origin, list = root.Position, {} for m, _ in pairs(Scanner.Models) do if m.Parent then if Scanner.IsValid(m, origin) then local r = Scanner.GetRoot(m) list[#list + 1] = { Model = m, Root = r, Dist = (r.Position - origin).Magnitude } end else Scanner.Models[m] = nil end end table.sort(list, function(a, b) return a.Dist < b.Dist end) -- ưu tiên gần nhất Scanner.List = list end)) end ------------------------------------------------------------------ CombatEngine local Combat = { Target = nil, _last = 0 } -- >>> CẮM CƠ CHẾ TẤN CÔNG CỦA GAME VÀO ĐÂY <<< -- target: Model mục tiêu; mode: "Dron" | "Kill" | "AutoShoot". -- Mặc định: kích hoạt Tool đang cầm. Game dùng RemoteEvent thì ghi đè từ ngoài, ví dụ: -- getgenv().HpTeamPro.Combat.AttackHook = function(target, mode) -- game.ReplicatedStorage.RemoteEvents.XXX:FireServer(target) -- end function Combat.AttackHook(target, mode) local c = LocalPlayer.Character local tool = c and c:FindFirstChildOfClass("Tool") if tool then tool:Activate() end end function Combat.Attack(t, mode) local now = os.clock() if now - Combat._last < State.Config.AttackInterval then return end Combat._last = now local ok, e = pcall(Combat.AttackHook, t.Model, mode) if not ok then warn("[HP] AttackHook: " .. tostring(e)) end end -- Khóa mục tiêu tạm thời: giữ mục tiêu cũ đến khi chết / biến mất / ra khỏi 150, rồi tự chuyển sang mục tiêu gần nhất function Combat.Pick(origin) local t = Combat.Target if t and Scanner.IsValid(t.Model, origin) then t.Root = Scanner.GetRoot(t.Model) return t end Combat.Target = nil for _, e in ipairs(Scanner.List) do if Scanner.IsValid(e.Model, origin) then Combat.Target = e break end end return Combat.Target end function Combat.AimPart(m) return m:FindFirstChild("Head") or Scanner.GetRoot(m) end local cMaid = { TeleDron = Maid.new(), TeleKill = Maid.new(), Aimbot = Maid.new(), AimMagic = Maid.new(), AutoShoot = Maid.new(), } -- Tele Dron: lơ lửng phía trên mục tiêu, triệt tiêu lực rơi/đẩy, bám theo và đánh hướng xuống State:On("TeleDron", function(on) cMaid.TeleDron:Clean() if not on then return end State:Set("TeleKill", false) cMaid.TeleDron:Add(RunService.Heartbeat:Connect(function() local _, r = getChar() if not r then return end local t = Combat.Pick(r.Position) if not t then return end local tp = t.Root.Position local pos = tp + Vector3.new(0, State.Config.DroneHeightOffset, 0) r.CFrame = CFrame.lookAt(pos, tp, Vector3.zAxis) r.AssemblyLinearVelocity = Vector3.zero r.AssemblyAngularVelocity = Vector3.zero Combat.Attack(t, "Dron") end)) end) -- Tele Kill: dịch tới sau lưng mục tiêu gần nhất rồi đánh; mục tiêu chết thì Pick tự đổi State:On("TeleKill", function(on) cMaid.TeleKill:Clean() if not on then return end State:Set("TeleDron", false) cMaid.TeleKill:Add(RunService.Heartbeat:Connect(function() local _, r = getChar() if not r then return end local t = Combat.Pick(r.Position) if not t then return end local tp = t.Root.Position local pos = tp - t.Root.CFrame.LookVector * 4 r.CFrame = CFrame.lookAt(pos, Vector3.new(tp.X, pos.Y, tp.Z)) r.AssemblyLinearVelocity = Vector3.zero Combat.Attack(t, "Kill") end)) end) -- Aimbot: Lerp camera (0.3) để mượt, không giật khi đổi mục tiêu State:On("Aimbot", function(on) cMaid.Aimbot:Clean() if not on then return end cMaid.Aimbot:Add(RunService.RenderStepped:Connect(function() local cam = Workspace.CurrentCamera local _, r = getChar() if not cam or not r then return end local t = Combat.Pick(r.Position) if not t then return end local p = Combat.AimPart(t.Model) if not p then return end cam.CFrame = cam.CFrame:Lerp(CFrame.lookAt(cam.CFrame.Position, p.Position), 0.3) end)) end) -- Aim Magic: chỉ sửa điểm ngắm (Mouse.Hit/Target và Raycast) khi đang bấm bắn, KHÔNG đụng camera local shooting, magicPart, hooked = false, nil, false G:Add(UIS.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then shooting = true end end)) G:Add(UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then shooting = false end end)) local function installAimMagic() if hooked then return true end if not (hookmetamethod and checkcaller and getnamecallmethod) then warn("[HP] Executor thiếu hookmetamethod/checkcaller -> không bật được Aim Magic") return false end local mouse = LocalPlayer:GetMouse() local oldIndex oldIndex = hookmetamethod(game, "__index", newcc(function(self, k) if shooting and magicPart and self == mouse and not checkcaller() then if k == "Hit" then return CFrame.new(magicPart.Position) end if k == "Target" then return magicPart end end return oldIndex(self, k) end)) local oldNC oldNC = hookmetamethod(game, "__namecall", newcc(function(self, ...) if shooting and magicPart and self == Workspace and not checkcaller() and getnamecallmethod() == "Raycast" then local o, d, p = ... if typeof(o) == "Vector3" and typeof(d) == "Vector3" then return oldNC(self, o, (magicPart.Position - o).Unit * d.Magnitude, p) end end return oldNC(self, ...) end)) hooked = true return true end State:On("AimMagic", function(on) cMaid.AimMagic:Clean() magicPart = nil if not on then return end if not installAimMagic() then State:Set("AimMagic", false) return end cMaid.AimMagic:Add(RunService.Heartbeat:Connect(function() local _, r = getChar() local t = r and Combat.Pick(r.Position) magicPart = t and Combat.AimPart(t.Model) or nil end)) cMaid.AimMagic:Add(function() magicPart = nil end) end) -- Auto Bắn: chỉ gọi AttackHook, không động camera/con trỏ State:On("AutoShoot", function(on) cMaid.AutoShoot:Clean() if not on then return end cMaid.AutoShoot:Add(RunService.Heartbeat:Connect(function() local _, r = getChar() local t = r and Combat.Pick(r.Position) if t then Combat.Attack(t, "AutoShoot") end end)) end) ------------------------------------------------------------------ EspEngine local Esp = { Entries = {}, WS = {} } local GREEN = Color3.fromRGB(0, 255, 102) local wsMaid = Maid.new() local function rm(o) if o then pcall(function() o:Remove() end) end end local function killEntry(e) rm(e.Line) rm(e.Box) rm(e.Name) rm(e.Dist) if e.HL then e.HL:Destroy() end end local function drawing(e, key, on, kind, props) if on then if not e[key] then local o = Drawing.new(kind) for k, v in pairs(props) do o[k] = v end e[key] = o end return e[key] elseif e[key] then rm(e[key]) e[key] = nil end end local function makeHL(adornee, fill) local h = Instance.new("Highlight") h.FillColor, h.OutlineColor = fill, Color3.new(1, 1, 1) h.FillTransparency, h.OutlineTransparency = 0.5, 0 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop -- xuyên tường h.Adornee = adornee h.Parent = Workspace.CurrentCamera return h end local function updateEntry(e, t, cam, root) local m = t.Model if State:Get("EspHolo") then if not e.HL or not e.HL.Parent then e.HL = makeHL(m, GREEN) end elseif e.HL then e.HL:Destroy() e.HL = nil end if not hasDrawing then return end -- World-to-Screen: chiếu 8 đỉnh bounding box lên màn hình local cf, size = m:GetBoundingBox() local h = size / 2 local minX, minY, maxX, maxY, vis = math.huge, math.huge, -math.huge, -math.huge, false for x = -1, 1, 2 do for y = -1, 1, 2 do for z = -1, 1, 2 do local v = cam:WorldToViewportPoint((cf * CFrame.new(h.X * x, h.Y * y, h.Z * z)).Position) if v.Z > 0 then vis = true minX, maxX = math.min(minX, v.X), math.max(maxX, v.X) minY, maxY = math.min(minY, v.Y), math.max(maxY, v.Y) end end end end local c = cam:WorldToViewportPoint(t.Root.Position) vis = vis and c.Z > 0 local line = drawing(e, "Line", State:Get("EspLine"), "Line", { Thickness = 1, Color = GREEN }) if line then line.Visible = vis if vis then line.From = Vector2.new(cam.ViewportSize.X / 2, 0) -- cạnh trên giữa màn hình line.To = Vector2.new(c.X, c.Y) end end local box = drawing(e, "Box", State:Get("EspBox"), "Square", { Thickness = 1, Filled = false, Color = GREEN }) if box then box.Visible = vis if vis then box.Position = Vector2.new(minX, minY) box.Size = Vector2.new(maxX - minX, maxY - minY) end end local txt = { Size = 13, Center = true, Outline = true, Color = Color3.new(1, 1, 1) } local nm = drawing(e, "Name", State:Get("EspName"), "Text", txt) if nm then nm.Visible = vis if vis then nm.Text = m.Name nm.Position = Vector2.new((minX + maxX) / 2, minY - 16) end end local ds = drawing(e, "Dist", State:Get("EspDist"), "Text", txt) if ds then ds.Visible = vis if vis then local d = (t.Root.Position - root.Position).Magnitude ds.Text = string.format("%d studs | %.0f m", d, d * 0.28) ds.Position = Vector2.new((minX + maxX) / 2, maxY + 2) end end end function Esp.CleanupAll() for m, e in pairs(Esp.Entries) do killEntry(e) Esp.Entries[m] = nil end wsMaid:Clean() for c, h in pairs(Esp.WS) do h:Destroy() Esp.WS[c] = nil end end G:Add(RunService.RenderStepped:Connect(function() local seen = {} local want = State:Any("EspLine", "EspBox", "EspName", "EspDist") or State:Get("EspHolo") local cam = Workspace.CurrentCamera local _, root = getChar() if want and cam and root then for _, t in ipairs(Scanner.List) do local m = t.Model if Scanner.IsValid(m, root.Position) then -- mob chết / ra khỏi 150 -> không vào seen -> bị xoá seen[m] = true local e = Esp.Entries[m] if not e then e = {} Esp.Entries[m] = e end updateEntry(e, t, cam, root) end end end for m, e in pairs(Esp.Entries) do if not seen[m] then killEntry(e) Esp.Entries[m] = nil end end end)) -- Esp Workspace: highlight vật phẩm trong workspace.Item (kiểm tra tồn tại trước) State:On("EspWorkspace", function(on) wsMaid:Clean() for c, h in pairs(Esp.WS) do h:Destroy() Esp.WS[c] = nil end if not on then return end local folder = Workspace:FindFirstChild("Item") if not folder then warn("[HP] Không có workspace.Item") State:Set("EspWorkspace", false) return end local function add(c) if (c:IsA("Model") or c:IsA("BasePart")) and not Esp.WS[c] then Esp.WS[c] = makeHL(c, Color3.fromRGB(255, 220, 0)) end end for _, c in ipairs(folder:GetChildren()) do add(c) end wsMaid:Add(folder.ChildAdded:Connect(add)) wsMaid:Add(folder.ChildRemoved:Connect(function(c) if Esp.WS[c] then Esp.WS[c]:Destroy() Esp.WS[c] = nil end end)) end) ------------------------------------------------------------------ MovementAndWorld local Mv = { Users = {}, Orig = setmetatable({}, { __mode = "k" }) } local ncMaid, spMaid, jaMaid, nvMaid, lagMaid, flyMaid = Maid.new(), Maid.new(), Maid.new(), Maid.new(), Maid.new(), Maid.new() -- No Clip dùng chung (NoClip + Fly Down) bằng bộ đếm người dùng function Mv.Noclip(user, on) Mv.Users[user] = on or nil if next(Mv.Users) then if #ncMaid._t == 0 then ncMaid:Add(RunService.Stepped:Connect(function() local c = LocalPlayer.Character if not c then return end for _, p in ipairs(c:GetDescendants()) do if p:IsA("BasePart") then if Mv.Orig[p] == nil then Mv.Orig[p] = p.CanCollide end -- lưu trạng thái gốc p.CanCollide = false end end end)) end else ncMaid:Clean() for p, v in pairs(Mv.Orig) do if p.Parent then p.CanCollide = v end Mv.Orig[p] = nil end end end State:On("NoClip", function(on) Mv.Noclip("NoClip", on) end) -- Bay: giữ độ cao bằng cách ghi đè vận tốc mỗi frame (không tự rơi) local Fly = { Mode = nil, Y = 0, Hold = 0, Label = "" } local function groundY(char, pos) local p = RaycastParams.new() p.FilterType = Enum.RaycastFilterType.Exclude p.FilterDescendantsInstances = { char } local r = Workspace:Raycast(pos, Vector3.new(0, -1000, 0), p) return r and r.Position.Y end function Fly.Stop() flyMaid:Clean() local snap = State.Snapshot.Fly if snap and snap.Hum and snap.Hum.Parent then snap.Hum.PlatformStand = snap.PlatformStand end State.Snapshot.Fly = nil Mv.Noclip("FlyDown", false) Fly.Mode, Fly.Hold = nil, 0 end function Fly.Start(mode) local char, root, hum = getChar() if not root then State:Set("Fly" .. mode, false) return end Fly.Mode = mode State.Snapshot.Fly = { Hum = hum, PlatformStand = hum.PlatformStand } hum.PlatformStand = true Fly.Y = root.Position.Y if mode == "Down" then Fly.Y -= 10 -- chui xuống dưới mặt đất Mv.Noclip("FlyDown", true) elseif mode == "Dron" then Fly.Y = (groundY(char, root.Position) or Fly.Y) + State.Config.FlyDronHeight end flyMaid:Add(RunService.Heartbeat:Connect(function(dt) local c, r, h = getChar() local cam = Workspace.CurrentCamera if not r or not cam then return end local cfg = State.Config local pos = r.Position if not h.PlatformStand then h.PlatformStand = true end if mode == "Dron" then if Fly.Hold ~= 0 then State:SetConfig("FlyDronHeight", math.clamp(cfg.FlyDronHeight + Fly.Hold * cfg.FlyStep * dt, 1, 500)) end local g = groundY(c, pos) if g then Fly.Y = g + cfg.FlyDronHeight end -- độ cao cố định theo mặt đất Fly.Label = string.format("Cao: %.1f", cfg.FlyDronHeight) else Fly.Y += Fly.Hold * cfg.FlyStep * dt Fly.Label = string.format("Y: %.0f", Fly.Y) end local md = h.MoveDirection local vy = math.clamp((Fly.Y - pos.Y) * 5, -cfg.FlyStep, cfg.FlyStep) -- lên/xuống từ từ local look = cam.CFrame.LookVector local yaw = math.atan2(-look.X, -look.Z) local tilt = (mode == "Dron" and -math.pi / 2) or (mode == "Down" and math.pi / 2) or 0 -- úp / ngửa / đứng r.CFrame = CFrame.new(pos) * CFrame.Angles(0, yaw, 0) * CFrame.Angles(tilt, 0, 0) r.AssemblyLinearVelocity = Vector3.new(md.X * cfg.FlySpeed, vy, md.Z * cfg.FlySpeed) r.AssemblyAngularVelocity = Vector3.zero end)) end for _, mode in ipairs({ "Air", "Dron", "Down" }) do State:On("Fly" .. mode, function(on) if on then for _, o in ipairs({ "Air", "Dron", "Down" }) do if o ~= mode then State:Set("Fly" .. o, false) end end Fly.Start(mode) elseif Fly.Mode == mode then Fly.Stop() end end) end G:Add(LocalPlayer.CharacterAdded:Connect(function() for _, n in ipairs({ "FlyAir", "FlyDron", "FlyDown" }) do State:Set(n, false) end end)) -- Speed State:On("Speed", function(on) spMaid:Clean() if not on then local s = State.Snapshot.Speed if s and s.Hum and s.Hum.Parent then s.Hum.WalkSpeed = s.Value end State.Snapshot.Speed = nil return end spMaid:Add(RunService.Heartbeat:Connect(function() local _, _, h = getChar() if not h then return end local s = State.Snapshot.Speed if not s or s.Hum ~= h then s = { Hum = h, Value = h.WalkSpeed } -- lưu tốc độ gốc theo từng Humanoid State.Snapshot.Speed = s end h.WalkSpeed = State.Config.WalkSpeed end)) end) -- Jumping Air State:On("JumpAir", function(on) jaMaid:Clean() if not on then return end jaMaid:Add(UIS.JumpRequest:Connect(function() local _, _, h = getChar() if h then h:ChangeState(Enum.HumanoidStateType.Jumping) end end)) end) -- Night Vision local NV_PROPS = { "Brightness", "ClockTime", "FogEnd", "FogStart", "Ambient", "OutdoorAmbient", "ExposureCompensation" } State:On("NightVision", function(on) nvMaid:Clean() local snap = State.Snapshot.NV if not on then if snap then for p, v in pairs(snap.Props) do Lighting[p] = v end for a, v in pairs(snap.Atmo) do if a.Parent then a.Density, a.Haze = v[1], v[2] end end end State.Snapshot.NV = nil return end snap = { Props = {}, Atmo = {} } for _, p in ipairs(NV_PROPS) do snap.Props[p] = Lighting[p] end State.Snapshot.NV = snap local function apply() Lighting.Brightness, Lighting.ClockTime = 2, 14 Lighting.FogStart, Lighting.FogEnd = 1e5, 1e6 Lighting.Ambient = Color3.fromRGB(200, 200, 200) Lighting.OutdoorAmbient = Color3.fromRGB(200, 200, 200) for _, a in ipairs(Lighting:GetChildren()) do if a:IsA("Atmosphere") then if not snap.Atmo[a] then snap.Atmo[a] = { a.Density, a.Haze } end a.Density, a.Haze = 0, 0 end end end apply() local acc = 0 nvMaid:Add(RunService.Heartbeat:Connect(function(dt) acc += dt if acc > 0.5 then acc = 0 apply() end -- game đổi lại thì áp lại end)) end) -- Fix Lag (tắt hiệu ứng nặng, có lưu để khôi phục khi tắt) local lagGen = 0 State:On("FixLag", function(on) lagGen += 1 local gen = lagGen lagMaid:Clean() if not on then local snap = State.Snapshot.Lag State.Snapshot.Lag = nil if not snap then return end pcall(function() settings().Rendering.QualityLevel = snap.Quality end) Lighting.GlobalShadows = snap.Shadows task.spawn(function() local n = 0 for i, rec in pairs(snap.Items) do if i.Parent then pcall(function() i[rec[1]] = rec[2] end) end n += 1 if n % 400 == 0 then task.wait() end end end) return end local snap = { Items = {}, Shadows = Lighting.GlobalShadows } State.Snapshot.Lag = snap pcall(function() local r = settings().Rendering snap.Quality = r.QualityLevel r.QualityLevel = Enum.QualityLevel.Level01 end) Lighting.GlobalShadows = false local function reduce(i) local prop if i:IsA("ParticleEmitter") or i:IsA("Trail") or i:IsA("Beam") or i:IsA("Fire") or i:IsA("Smoke") or i:IsA("Sparkles") or i:IsA("PostEffect") then prop = "Enabled" elseif i:IsA("BasePart") then prop = "CastShadow" end if prop and i[prop] ~= false then if not snap.Items[i] then snap.Items[i] = { prop, i[prop] } end i[prop] = false end end lagMaid:Add(Workspace.DescendantAdded:Connect(reduce)) lagMaid:Add(Lighting.DescendantAdded:Connect(reduce)) task.spawn(function() local n = 0 for _, root in ipairs({ Workspace, Lighting }) do for _, i in ipairs(root:GetDescendants()) do if gen ~= lagGen then return end reduce(i) n += 1 if n % 400 == 0 then task.wait() end end end end) end) ------------------------------------------------------------------ UIController local UI = {} local function mk(class, props, parent) local i = Instance.new(class) for k, v in pairs(props) do i[k] = v end i.Parent = parent return i end local BG, BG2 = Color3.fromRGB(12, 14, 12), Color3.fromRGB(20, 24, 20) local function guiParent() if gethui then local ok, h = pcall(gethui) if ok and h then return h end end return LocalPlayer:WaitForChild("PlayerGui") end function UI.Build() local gui = mk("ScreenGui", { Name = "Hp Team Pro V1", ResetOnSpawn = false, DisplayOrder = 999 }, guiParent()) G:Add(gui) local main = mk("Frame", { Size = UDim2.fromOffset(350, 200), Position = UDim2.new(0.5, -175, 0.5, -100), BackgroundColor3 = BG, BorderSizePixel = 0, ClipsDescendants = true, }, gui) mk("UIStroke", { Color = GREEN, Thickness = 1.5 }, main) local header = mk("Frame", { Size = UDim2.new(1, 0, 0, 24), BackgroundColor3 = BG2, BorderSizePixel = 0 }, main) mk("TextLabel", { Size = UDim2.new(1, -60, 1, 0), Position = UDim2.fromOffset(8, 0), BackgroundTransparency = 1, Text = "Hp Team Pro V1", TextColor3 = GREEN, Font = Enum.Font.Code, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Left, }, header) local function hbtn(txt, x) return mk("TextButton", { Size = UDim2.fromOffset(24, 24), Position = UDim2.new(1, x, 0, 0), BackgroundTransparency = 1, Text = txt, TextColor3 = GREEN, Font = Enum.Font.Code, TextSize = 14, }, header) end local minBtn, closeBtn = hbtn("-", -52), hbtn("X", -26) -- Kéo thả menu local dragging, dStart, pStart G:Add(header.InputBegan:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging, dStart, pStart = true, i.Position, main.Position end end)) G:Add(UIS.InputChanged:Connect(function(i) if dragging and (i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch) then local d = i.Position - dStart main.Position = UDim2.new(pStart.X.Scale, pStart.X.Offset + d.X, pStart.Y.Scale, pStart.Y.Offset + d.Y) end end)) G:Add(UIS.InputEnded:Connect(function(i) if i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch then dragging = false end end)) local tabBar = mk("Frame", { Size = UDim2.new(1, 0, 0, 22), Position = UDim2.fromOffset(0, 24), BackgroundTransparency = 1 }, main) mk("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 2) }, tabBar) local pages, tabBtns = {}, {} local function showTab(name) for n, p in pairs(pages) do p.Visible = n == name tabBtns[n].BackgroundColor3 = n == name and Color3.fromRGB(0, 90, 40) or BG2 end end for _, n in ipairs({ "Main", "Esp", "Khác" }) do tabBtns[n] = mk("TextButton", { Size = UDim2.new(1 / 3, -2, 1, 0), BackgroundColor3 = BG2, BorderSizePixel = 0, Text = n, TextColor3 = GREEN, Font = Enum.Font.Code, TextSize = 12, }, tabBar) pages[n] = mk("ScrollingFrame", { Size = UDim2.new(1, -4, 1, -50), Position = UDim2.fromOffset(2, 48), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 3, ScrollBarImageColor3 = GREEN, Visible = false, CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y, }, main) mk("UIListLayout", { Padding = UDim.new(0, 3) }, pages[n]) G:Add(tabBtns[n].MouseButton1Click:Connect(function() showTab(n) end)) end local function addToggle(tab, name, label) local b = mk("TextButton", { Size = UDim2.new(1, -6, 0, 22), BackgroundColor3 = BG2, BorderSizePixel = 0, Font = Enum.Font.Code, TextSize = 12, TextColor3 = Color3.new(1, 1, 1), RichText = true, TextXAlignment = Enum.TextXAlignment.Left, }, pages[tab]) mk("UIPadding", { PaddingLeft = UDim.new(0, 6) }, b) local function refresh() local on = State:Get(name) b.Text = string.format('%s %s', label, on and "#00FF66" or "#FF4040", on and "ON" or "OFF") end refresh() G:Add(b.MouseButton1Click:Connect(function() State:Set(name, not State:Get(name)) end)) table.insert(State.Listeners, function(n) if n == name then refresh() end end) end local function addNumber(tab, key, label, min, max) local f = mk("Frame", { Size = UDim2.new(1, -6, 0, 22), BackgroundColor3 = BG2, BorderSizePixel = 0 }, pages[tab]) mk("TextLabel", { Size = UDim2.new(1, -70, 1, 0), Position = UDim2.fromOffset(6, 0), BackgroundTransparency = 1, Text = label, TextColor3 = Color3.new(1, 1, 1), Font = Enum.Font.Code, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Left, }, f) local box = mk("TextBox", { Size = UDim2.fromOffset(60, 18), Position = UDim2.new(1, -64, 0, 2), BackgroundColor3 = BG, Text = tostring(State.Config[key]), TextColor3 = GREEN, Font = Enum.Font.Code, TextSize = 12, ClearTextOnFocus = false, }, f) mk("UIStroke", { Color = GREEN, Thickness = 1 }, box) G:Add(box.FocusLost:Connect(function() local n = tonumber(box.Text) if n then State:SetConfig(key, math.clamp(n, min, max)) end box.Text = tostring(State.Config[key]) -- giá trị sai thì trả về giá trị cũ end)) table.insert(State.CfgListeners, function(k) if k == key and not box:IsFocused() then box.Text = string.format("%.1f", State.Config[key]):gsub("%.0$", "") end end) end -- TAB MAIN addToggle("Main", "TeleDron", "Tele Dron") addNumber("Main", "DroneHeightOffset", "Cao an toàn (Dron)", 3, 100) addToggle("Main", "TeleKill", "Tele Kill") addToggle("Main", "Aimbot", "Aimbot") addToggle("Main", "AimMagic", "Aim Magic") addToggle("Main", "AutoShoot", "Auto Bắn") addNumber("Main", "ScanRange", "Phạm vi quét", 10, 1000) -- TAB ESP addToggle("Esp", "EspLine", "Esp Line") addToggle("Esp", "EspBox", "Esp Box") addToggle("Esp", "EspName", "Esp Name") addToggle("Esp", "EspDist", "Esp Distance") addToggle("Esp", "EspHolo", "Esp Hologram") addToggle("Esp", "EspWorkspace", "Esp Workspace") -- TAB KHÁC addToggle("Khác", "FlyDown", "Fly Down") addToggle("Khác", "FlyDron", "Fly Dron") addNumber("Khác", "FlyDronHeight", "Độ cao Fly Dron", 1, 500) addToggle("Khác", "NoClip", "No Clip") addToggle("Khác", "FlyAir", "Fly Air") addNumber("Khác", "FlySpeed", "Fly Speed", 1, 500) addToggle("Khác", "Speed", "Speed") addNumber("Khác", "WalkSpeed", "Speed (giá trị)", 1, 500) addToggle("Khác", "JumpAir", "Jumping Air") addToggle("Khác", "NightVision", "Night Vision") addToggle("Khác", "FixLag", "Fix Lag") showTab("Main") -- Cụm nút tăng/giảm độ cao khi bay (giữ để tăng/giảm liên tục) local ctrl = mk("Frame", { Size = UDim2.fromOffset(64, 120), Position = UDim2.new(1, -76, 0.5, -60), BackgroundColor3 = BG, BorderSizePixel = 0, Visible = false, }, gui) mk("UIStroke", { Color = GREEN, Thickness = 1.5 }, ctrl) local function cbtn(txt, y, dir) local b = mk("TextButton", { Size = UDim2.new(1, -8, 0, 40), Position = UDim2.fromOffset(4, y), BackgroundColor3 = BG2, BorderSizePixel = 0, Text = txt, TextColor3 = GREEN, Font = Enum.Font.Code, TextSize = 20, }, ctrl) G:Add(b.MouseButton1Down:Connect(function() Fly.Hold = dir end)) G:Add(b.MouseButton1Up:Connect(function() Fly.Hold = 0 end)) G:Add(b.MouseLeave:Connect(function() Fly.Hold = 0 end)) end cbtn("▲", 4, 1) local lbl = mk("TextLabel", { Size = UDim2.new(1, 0, 0, 24), Position = UDim2.fromOffset(0, 48), BackgroundTransparency = 1, Text = "", TextColor3 = Color3.new(1, 1, 1), Font = Enum.Font.Code, TextSize = 11, }, ctrl) cbtn("▼", 76, -1) G:Add(RunService.RenderStepped:Connect(function() ctrl.Visible = Fly.Mode ~= nil if Fly.Mode then lbl.Text = Fly.Label end end)) -- Thu gọn / thoát local collapsed = false G:Add(minBtn.MouseButton1Click:Connect(function() collapsed = not collapsed main.Size = collapsed and UDim2.fromOffset(350, 24) or UDim2.fromOffset(350, 200) tabBar.Visible = not collapsed for _, p in pairs(pages) do if collapsed then p.Visible = false end end if not collapsed then showTab("Main") end end)) G:Add(closeBtn.MouseButton1Click:Connect(function() genv.HpTeamProDestroy() end)) end ------------------------------------------------------------------ Khởi động / dọn dẹp local function destroy() for n in pairs(State.Toggles) do State:Set(n, false) end -- tắt hết: khôi phục Snapshot, ngắt kết nối Esp.CleanupAll() G:Clean() if genv.HpTeamProDestroy == destroy then genv.HpTeamProDestroy = nil end genv.HpTeamPro = nil end genv.HpTeamProDestroy = destroy genv.HpTeamPro = { State = State, Combat = Combat, Scanner = Scanner } -- để ghi đè AttackHook từ ngoài Scanner.Init() UI.Build() print("[HP] Hp Team Pro V1 đã tải")