--[[ Hp Team Pro V1 - LocalScript Đặt tại: StarterPlayer > StarterPlayerScripts Chỉ dùng API chuẩn của Roblox (không Drawing/executor): ESP vẽ bằng Frame/Highlight. Module: StateManager | TargetScanner | CombatEngine | EspEngine | MovementAndWorld | UIController ]] 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 Camera = Workspace.CurrentCamera local GREEN = Color3.fromHex("00FF66") local BG1 = Color3.fromHex("0C0E0C") local BG2 = Color3.fromHex("141814") --------------------------------------------------------------------- -- Tiện ích chung --------------------------------------------------------------------- -- Janitor: gom connection/instance/hàm để dọn sạch một lần (chống rò rỉ khi bật/tắt nhiều lần) local Janitor = {} Janitor.__index = Janitor function Janitor.new() return setmetatable({ items = {} }, Janitor) end function Janitor:Add(x) table.insert(self.items, x) return x end function Janitor:Clean() local items = self.items self.items = {} for _, i in ipairs(items) do local t = typeof(i) if t == "RBXScriptConnection" then i:Disconnect() elseif t == "Instance" then i:Destroy() elseif t == "function" then pcall(i) end end end local function getChar() return LocalPlayer.Character end local function getHRP() local c = LocalPlayer.Character return c and c:FindFirstChild("HumanoidRootPart") end local function getHum() local c = LocalPlayer.Character return c and c:FindFirstChildOfClass("Humanoid") end local function clamp(v, lo, hi) return math.max(lo, math.min(hi, v)) end local function groundRay(origin, length) local p = RaycastParams.new() p.FilterType = Enum.RaycastFilterType.Exclude p.FilterDescendantsInstances = { LocalPlayer.Character } return Workspace:Raycast(origin, Vector3.new(0, -length, 0), p) end --------------------------------------------------------------------- -- StateManager: cờ bật/tắt, cấu hình, snapshot giá trị gốc --------------------------------------------------------------------- local State = { Flags = {}, Features = {}, Snapshot = {}, Listeners = {}, CfgListeners = {}, Config = { ScanRange = 150, DroneHeightOffset = 15, -- khoảng cách an toàn phía trên mục tiêu của Tele Dron KillDistance = 4, FlySpeed = 50, WalkSpeed = 32, FlyDronHeight = 6, -- độ cao mặc định của Fly Dron FlyDownDepth = 10, -- độ sâu khi bật Fly Down AimSmooth = 0.25, AttackInterval = 0.2, }, } -- Các tính năng điều khiển vị trí không chạy cùng lúc (tránh giành CFrame) local GROUP_POSITION = { "TeleDron", "TeleKill", "FlyAir", "FlyDown", "FlyDron" } function State:Register(name, enable, disable, grouped) self.Features[name] = { enable = enable, disable = disable, grouped = grouped } end function State:Get(name) return self.Flags[name] == true end function State:OnChanged(fn) table.insert(self.Listeners, fn) end function State:OnConfig(fn) table.insert(self.CfgListeners, fn) end function State:SetConfig(key, value) self.Config[key] = value for _, fn in ipairs(self.CfgListeners) do pcall(fn, key, value) end end function State:SetEnabled(name, on) local f = self.Features[name] if not f then return end on = on == true if self.Flags[name] == on then return end if on and f.grouped then for _, other in ipairs(GROUP_POSITION) do if other ~= name and self.Flags[other] then self:SetEnabled(other, false) end end end self.Flags[name] = on local ok, err = pcall(on and f.enable or f.disable) if not ok then warn("[HpTeamPro] " .. name .. " lỗi: " .. tostring(err)) end for _, fn in ipairs(self.Listeners) do pcall(fn, name, on) end end -- Snapshot: chỉ lưu lần đầu, bọc trong bảng để lưu được cả nil/false function State:Save(key, value) if self.Snapshot[key] == nil then self.Snapshot[key] = { v = value } end end function State:Restore(key) local s = self.Snapshot[key] self.Snapshot[key] = nil return s and s.v end --------------------------------------------------------------------- -- TargetScanner: cache Humanoid, lọc theo khoảng cách ở nhịp riêng --------------------------------------------------------------------- local Scanner = { Candidates = {}, Result = {}, Interval = 0.12, _last = 0, _jan = Janitor.new() } local function isPlayerModel(model) return model == LocalPlayer.Character or Players:GetPlayerFromCharacter(model) ~= nil end function Scanner:_register(inst) if inst:IsA("Humanoid") and inst.Parent and inst.Parent:IsA("Model") then self.Candidates[inst.Parent] = inst end end function Scanner:Init() for _, d in ipairs(Workspace:GetDescendants()) do self:_register(d) end self._jan:Add(Workspace.DescendantAdded:Connect(function(d) self:_register(d) end)) self._jan:Add(Workspace.DescendantRemoving:Connect(function(d) if d:IsA("Humanoid") and d.Parent then self.Candidates[d.Parent] = nil end end)) end -- Hợp lệ: không phải người chơi, Humanoid còn sống, có Root function Scanner:Validate(model, hum) if not model.Parent or hum.Parent ~= model or hum.Health <= 0 then return nil end if isPlayerModel(model) then return nil end local root = model:FindFirstChild("HumanoidRootPart") or model.PrimaryPart if not root or not root:IsA("BasePart") then return nil end return root end function Scanner:Update() local now = os.clock() if now - self._last < self.Interval then return self.Result end self._last = now local list, hrp = {}, getHRP() if hrp then local origin, range = hrp.Position, State.Config.ScanRange for model, hum in pairs(self.Candidates) do local root = self:Validate(model, hum) if root then local d = (root.Position - origin).Magnitude if d <= range then table.insert(list, { Model = model, Humanoid = hum, Root = root, Distance = d }) end end end table.sort(list, function(a, b) return a.Distance < b.Distance end) -- gần nhất trước end self.Result = list return list end --------------------------------------------------------------------- -- CombatEngine: Tele Dron / Tele Kill / Aimbot --------------------------------------------------------------------- local Combat = { Target = nil, _lastAtk = 0, _jan = { Dron = Janitor.new(), Kill = Janitor.new(), } } --[[ CẮM CƠ CHẾ TẤN CÔNG CỦA GAME VÀO ĐÂY: target = { Model, Humanoid, Root, Distance }, mode = "Dron" | "Kill". Ví dụ: ReplicatedStorage.Remotes.Attack:FireServer(target.Model) Mặc định: kích hoạt Tool đang cầm (hợp với vũ khí dùng Tool.Activated). ]] Combat.AttackHook = function(target, mode) local char = getChar() local tool = char and char:FindFirstChildOfClass("Tool") if tool then tool:Activate() end end function Combat:TryAttack(t, mode) local now = os.clock() if now - self._lastAtk < State.Config.AttackInterval then return end self._lastAtk = now local ok, err = pcall(self.AttackHook, t, mode) if not ok then warn("[HpTeamPro] AttackHook lỗi: " .. tostring(err)) end end -- Khóa mục tiêu: giữ mục tiêu hiện tại tới khi chết/biến mất/ngoài 150 rồi mới đổi (chống giật) function Combat:Pick() local list = Scanner:Update() local cur, hrp = self.Target, getHRP() if cur and hrp and cur.Model.Parent and cur.Humanoid.Health > 0 and cur.Root.Parent then if (cur.Root.Position - hrp.Position).Magnitude <= State.Config.ScanRange then return cur end end self.Target = list[1] return self.Target end local function dropTarget() Combat.Target = nil end State:Register("TeleDron", function() local jan = Combat._jan.Dron local hum = getHum() if hum then State:Save("PS_Dron", hum.PlatformStand) end jan:Add(RunService.Heartbeat:Connect(function() local t, hrp, h = Combat:Pick(), getHRP(), getHum() if not (t and hrp and h) then return end h.PlatformStand = true -- triệt tiêu lực rơi/đẩy lùi khi lơ lửng local tp = t.Root.Position local p = tp + Vector3.new(0, State.Config.DroneHeightOffset, 0) -- up = zAxis để tránh suy biến khi nhìn thẳng xuống hrp.CFrame = CFrame.lookAt(p, tp, Vector3.zAxis) hrp.AssemblyLinearVelocity = Vector3.zero hrp.AssemblyAngularVelocity = Vector3.zero Combat:TryAttack(t, "Dron") end)) end, function() Combat._jan.Dron:Clean() local h = getHum() local old = State:Restore("PS_Dron") if h and old ~= nil then h.PlatformStand = old end dropTarget() end, true) State:Register("TeleKill", function() Combat._jan.Kill:Add(RunService.Heartbeat:Connect(function() local t, hrp = Combat:Pick(), getHRP() if not (t and hrp) then return end local tp = t.Root.Position local away = Vector3.new(hrp.Position.X - tp.X, 0, hrp.Position.Z - tp.Z) if away.Magnitude < 0.1 then away = -t.Root.CFrame.LookVector end local p = tp + away.Unit * State.Config.KillDistance hrp.CFrame = CFrame.lookAt(p, Vector3.new(tp.X, p.Y, tp.Z)) hrp.AssemblyLinearVelocity = Vector3.zero Combat:TryAttack(t, "Kill") end)) end, function() Combat._jan.Kill:Clean() dropTarget() end, true) State:Register("Aimbot", function() RunService:BindToRenderStep("HpAimbot", Enum.RenderPriority.Camera.Value + 1, function(dt) local cam = Workspace.CurrentCamera local t = Combat:Pick() if not (cam and t) then return end local head = t.Model:FindFirstChild("Head") local aim = (head and head:IsA("BasePart")) and head.Position or t.Root.Position local want = CFrame.lookAt(cam.CFrame.Position, aim) -- Lerp theo dt: mượt và không rung khi đổi mục tiêu local a = 1 - (1 - State.Config.AimSmooth) ^ (dt * 60) cam.CFrame = cam.CFrame:Lerp(want, clamp(a, 0, 1)) end) end, function() pcall(function() RunService:UnbindFromRenderStep("HpAimbot") end) dropTarget() end, false) --------------------------------------------------------------------- -- EspEngine: Line/Box/Name/Distance/Hologram (Frame + Highlight) và Esp Workspace --------------------------------------------------------------------- local Esp = { Entries = {}, Gui = nil, _jan = Janitor.new(), _wsJan = Janitor.new(), _ws = {} } function Esp:Init() local gui = Instance.new("ScreenGui") gui.Name = "HpEsp" gui.IgnoreGuiInset = true -- khớp toạ độ WorldToViewportPoint gui.ResetOnSpawn = false gui.DisplayOrder = 5 gui.Parent = LocalPlayer:WaitForChild("PlayerGui") self.Gui = gui self._jan:Add(gui) self._jan:Add(RunService.RenderStepped:Connect(function() self:Step() end)) end local function mkLine(parent) local f = Instance.new("Frame") f.BorderSizePixel = 0 f.BackgroundColor3 = GREEN f.AnchorPoint = Vector2.new(0.5, 0.5) f.Parent = parent return f end local function mkBox(parent) local f = Instance.new("Frame") f.BackgroundTransparency = 1 f.BorderSizePixel = 0 local s = Instance.new("UIStroke") s.Color = GREEN s.Thickness = 1.5 s.Parent = f f.Parent = parent return f end local function mkLabel(parent) local l = Instance.new("TextLabel") l.BackgroundTransparency = 1 l.AnchorPoint = Vector2.new(0.5, 1) l.Size = UDim2.fromOffset(200, 28) l.TextColor3 = GREEN l.TextStrokeTransparency = 0.3 l.Font = Enum.Font.GothamBold l.TextSize = 13 l.Parent = parent return l end local function mkHighlight(adornee) local h = Instance.new("Highlight") h.Adornee = adornee h.FillColor = GREEN h.OutlineColor = Color3.new(1, 1, 1) h.FillTransparency = 0.6 h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop -- xuyên tường (Roblox giới hạn ~31 Highlight cùng lúc) h.Parent = adornee return h end -- Bật thì tạo, tắt thì huỷ ngay -> không kẹt đối tượng vẽ local function ensure(e, key, on, factory) if on then if not e[key] then e[key] = factory() end return e[key] elseif e[key] then e[key]:Destroy() e[key] = nil end return nil end function Esp:Remove(model) local e = self.Entries[model] if not e then return end for _, k in ipairs({ "Line", "Box", "Label", "Highlight" }) do if e[k] then e[k]:Destroy() end end self.Entries[model] = nil end function Esp:ClearAll() for model in pairs(self.Entries) do self:Remove(model) end end function Esp:Draw(e, myPos) local cam = Workspace.CurrentCamera local model, root = e.Model, e.Root local dist = (root.Position - myPos).Magnitude local fl, fb = State:Get("EspLine"), State:Get("EspBox") local fn, fd = State:Get("EspName"), State:Get("EspDistance") ensure(e, "Highlight", State:Get("EspHologram"), function() return mkHighlight(model) end) local line = ensure(e, "Line", fl, function() return mkLine(self.Gui) end) local box = ensure(e, "Box", fb, function() return mkBox(self.Gui) end) local label = ensure(e, "Label", fn or fd, function() return mkLabel(self.Gui) end) if not (line or box or label) then return end local vp = cam.ViewportSize local sp = cam:WorldToViewportPoint(root.Position) local front = sp.Z > 0 if line then line.Visible = front if front then local a, b = Vector2.new(vp.X / 2, 0), Vector2.new(sp.X, sp.Y) local d = b - a line.Size = UDim2.fromOffset(d.Magnitude, 1.5) line.Position = UDim2.fromOffset((a.X + b.X) / 2, (a.Y + b.Y) / 2) line.Rotation = math.deg(math.atan2(d.Y, d.X)) end end local cf, size = model:GetBoundingBox() if box then -- Chiếu 8 đỉnh bounding box 3D xuống 2D rồi lấy khung bao local minX, minY, maxX, maxY, any = 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 p = cam:WorldToViewportPoint(cf:PointToWorldSpace(size * 0.5 * Vector3.new(x, y, z))) if p.Z > 0 then any = true minX, maxX = math.min(minX, p.X), math.max(maxX, p.X) minY, maxY = math.min(minY, p.Y), math.max(maxY, p.Y) end end end end box.Visible = any if any then box.Position = UDim2.fromOffset(minX, minY) box.Size = UDim2.fromOffset(maxX - minX, maxY - minY) end end if label then local top = cam:WorldToViewportPoint(cf.Position + Vector3.new(0, size.Y / 2 + 0.5, 0)) label.Visible = top.Z > 0 local parts = {} if fn then table.insert(parts, model.Name) end if fd then table.insert(parts, string.format("%d studs (%.0fm)", dist, dist * 0.28)) end label.Text = table.concat(parts, "\n") label.Position = UDim2.fromOffset(top.X, top.Y) end end function Esp:Step() local on = State:Get("EspLine") or State:Get("EspBox") or State:Get("EspName") or State:Get("EspDistance") or State:Get("EspHologram") if not on then if next(self.Entries) then self:ClearAll() end return end local hrp = getHRP() if not hrp then return end local seen = {} for _, t in ipairs(Scanner:Update()) do seen[t.Model] = t end -- Mob chết / ra khỏi 150 / bị huỷ -> xoá ESP ngay for model, e in pairs(self.Entries) do if not seen[model] or e.Humanoid.Health <= 0 or not model.Parent then self:Remove(model) end end for model, t in pairs(seen) do local e = self.Entries[model] if not e then e = { Model = model, Humanoid = t.Humanoid, Root = t.Root } self.Entries[model] = e end e.Root = t.Root self:Draw(e, hrp.Position) end end for _, name in ipairs({ "EspLine", "EspBox", "EspName", "EspDistance", "EspHologram" }) do State:Register(name, function() end, function() end, false) -- Esp:Step tự tạo/dọn theo cờ end -- Esp Workspace: quét an toàn workspace.Item State:Register("EspWorkspace", function() local jan = Esp._wsJan local function add(child) if (child:IsA("Model") or child:IsA("BasePart")) and not Esp._ws[child] then local h = mkHighlight(child) Esp._ws[child] = h jan:Add(h) end end local function attach(folder) for _, c in ipairs(folder:GetChildren()) do add(c) end jan:Add(folder.ChildAdded:Connect(add)) jan:Add(folder.ChildRemoved:Connect(function(c) local h = Esp._ws[c] if h then h:Destroy() Esp._ws[c] = nil end end)) end local item = Workspace:FindFirstChild("Item") -- kiểm tra tồn tại trước khi truy cập local attached = false if item then attach(item) attached = true end jan:Add(Workspace.ChildAdded:Connect(function(c) if c.Name == "Item" and not attached then attached = true attach(c) end end)) end, function() Esp._wsJan:Clean() table.clear(Esp._ws) end, false) --------------------------------------------------------------------- -- MovementAndWorld --------------------------------------------------------------------- local Move = {} -- ===== NoClip (đếm lý do: Fly Down cũng dùng được) ===== local NoClip = { reasons = {}, orig = setmetatable({}, { __mode = "k" }), jan = Janitor.new(), running = false } function NoClip:Update() local any = next(self.reasons) ~= nil if any and not self.running then self.running = true self.jan:Add(RunService.Stepped:Connect(function() local c = getChar() if not c then return end for _, p in ipairs(c:GetDescendants()) do if p:IsA("BasePart") then if self.orig[p] == nil then self.orig[p] = p.CanCollide end p.CanCollide = false end end end)) elseif not any and self.running then self.running = false self.jan:Clean() for p, v in pairs(self.orig) do if p.Parent then p.CanCollide = v end -- khôi phục đúng trạng thái ban đầu end table.clear(self.orig) end end function NoClip:Set(reason, on) self.reasons[reason] = on or nil self:Update() end State:Register("NoClip", function() NoClip:Set("user", true) end, function() NoClip:Set("user", false) end, false) -- ===== Flight: Fly Air / Fly Down / Fly Dron ===== local Flight = { Mode = nil, Vertical = 0, _hold = 0, jan = Janitor.new(), Notify = function() end } function Flight:PadPress(dir) if self.Mode == "Dron" then self._hold += 1 local tok = self._hold task.spawn(function() while self._hold == tok and self.Mode == "Dron" do State:SetConfig("FlyDronHeight", clamp(State.Config.FlyDronHeight + dir, 1, 200)) task.wait(0.15) end end) else self.Vertical = dir end end function Flight:PadRelease(dir) self._hold += 1 if self.Vertical == dir then self.Vertical = 0 end end local function flatLook() local cam = Workspace.CurrentCamera local f = Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z) if f.Magnitude < 1e-3 then f = Vector3.new(0, 0, -1) end return f.Unit end function Flight:Step(dt) local hrp, hum = getHRP(), getHum() if not hrp or not hum or hum.Health <= 0 then return end hum.PlatformStand = true -- không để Humanoid tự rơi local cfg, mode = State.Config, self.Mode local move, flat, pos = hum.MoveDirection, flatLook(), hrp.Position local cf if mode == "Air" then -- Không nhấn gì => vận tốc 0 => đứng yên giữ độ cao pos += (move * cfg.FlySpeed + Vector3.new(0, self.Vertical * cfg.FlySpeed, 0)) * dt cf = CFrame.lookAt(pos, pos + (move.Magnitude > 0.1 and move or flat)) elseif mode == "Down" then -- Nằm ngửa mặt lên trời: look = +Y, đầu hướng về phía trước pos += (move * cfg.FlySpeed + Vector3.new(0, self.Vertical * cfg.FlySpeed, 0)) * dt cf = CFrame.fromMatrix(pos, Vector3.yAxis:Cross(flat), flat, -Vector3.yAxis) else -- Dron: úp mặt xuống, chỉ đi ngang; độ cao cố định so với mặt đất, đổi độ cao thì lên/xuống từ từ pos += move * cfg.FlySpeed * dt local hit = groundRay(pos + Vector3.new(0, 2, 0), 1000) if hit then local targetY = hit.Position.Y + cfg.FlyDronHeight local step = 8 * dt pos = Vector3.new(pos.X, pos.Y + clamp(targetY - pos.Y, -step, step), pos.Z) end cf = CFrame.fromMatrix(pos, (-Vector3.yAxis):Cross(flat), flat, Vector3.yAxis) end hrp.CFrame = cf hrp.AssemblyLinearVelocity = Vector3.zero hrp.AssemblyAngularVelocity = Vector3.zero end function Flight:Start(mode) self.Mode, self.Vertical = mode, 0 local hum = getHum() if hum then State:Save("PS_Flight", hum.PlatformStand) end if mode == "Down" then NoClip:Set("FlyDown", true) local hrp = getHRP() if hrp then hrp.CFrame += Vector3.new(0, -State.Config.FlyDownDepth, 0) end -- xuống dưới mặt đất end self.jan:Add(RunService.Heartbeat:Connect(function(dt) self:Step(dt) end)) self.jan:Add(UIS.InputBegan:Connect(function(i, gp) if gp then return end if i.KeyCode == Enum.KeyCode.E then self:PadPress(1) elseif i.KeyCode == Enum.KeyCode.Q then self:PadPress(-1) end end)) self.jan:Add(UIS.InputEnded:Connect(function(i) if i.KeyCode == Enum.KeyCode.E then self:PadRelease(1) elseif i.KeyCode == Enum.KeyCode.Q then self:PadRelease(-1) end end)) end function Flight:Stop(mode) if self.Mode ~= mode then return end self.jan:Clean() self._hold += 1 self.Mode, self.Vertical = nil, 0 local hrp, hum = getHRP(), getHum() local old = State:Restore("PS_Flight") if hum and old ~= nil then hum.PlatformStand = old end if hrp then hrp.AssemblyLinearVelocity = Vector3.zero local pos = hrp.Position if mode == "Down" then -- Đang ở dưới đất: đưa lên mặt đất trước khi trả va chạm local hit = groundRay(pos + Vector3.new(0, 500, 0), 1000) if hit then pos = hit.Position + Vector3.new(0, 5, 0) end end hrp.CFrame = CFrame.lookAt(pos, pos + flatLook()) -- đứng thẳng lại end if mode == "Down" then NoClip:Set("FlyDown", false) end end State:Register("FlyAir", function() Flight:Start("Air") end, function() Flight:Stop("Air") end, true) State:Register("FlyDown", function() Flight:Start("Down") end, function() Flight:Stop("Down") end, true) State:Register("FlyDron", function() Flight:Start("Dron") end, function() Flight:Stop("Dron") end, true) -- ===== Speed ===== local SpeedJan, speedHum, speedOrig = Janitor.new(), nil, nil State:Register("Speed", function() SpeedJan:Add(RunService.Heartbeat:Connect(function() local h = getHum() if not h then return end if speedHum ~= h then speedHum, speedOrig = h, h.WalkSpeed end -- snapshot cho mỗi lần hồi sinh if h.WalkSpeed ~= State.Config.WalkSpeed then h.WalkSpeed = State.Config.WalkSpeed end end)) end, function() SpeedJan:Clean() local h = getHum() if h and speedOrig and h == speedHum then h.WalkSpeed = speedOrig end speedHum, speedOrig = nil, nil end, false) -- ===== Jumping Air ===== local JumpJan = Janitor.new() State:Register("JumpingAir", function() JumpJan:Add(UIS.JumpRequest:Connect(function() local h = getHum() if h and h.Health > 0 then h:ChangeState(Enum.HumanoidStateType.Jumping) end end)) end, function() JumpJan:Clean() end, false) -- ===== Night Vision ===== local NV_PROPS = { "Brightness", "ClockTime", "FogStart", "FogEnd", "GlobalShadows", "Ambient", "OutdoorAmbient", "ExposureCompensation" } local NV_VALUES = { Brightness = 2, ClockTime = 14, FogStart = 0, FogEnd = 1e6, GlobalShadows = false, Ambient = Color3.fromRGB(200, 200, 200), OutdoorAmbient = Color3.fromRGB(200, 200, 200), ExposureCompensation = 0, } local NVJan, atmoOrig = Janitor.new(), {} local function applyNV() for _, p in ipairs(NV_PROPS) do if Lighting[p] ~= NV_VALUES[p] then pcall(function() Lighting[p] = NV_VALUES[p] end) end end for _, a in ipairs(Lighting:GetChildren()) do if a:IsA("Atmosphere") then if not atmoOrig[a] then atmoOrig[a] = { Density = a.Density, Haze = a.Haze } end a.Density, a.Haze = 0, 0 end end end State:Register("NightVision", function() for _, p in ipairs(NV_PROPS) do State:Save("NV_" .. p, Lighting[p]) end applyNV() local acc = 0 NVJan:Add(RunService.Heartbeat:Connect(function(dt) acc += dt if acc >= 1 then acc = 0 applyNV() end -- game có thể ghi đè ánh sáng, áp lại mỗi giây end)) end, function() NVJan:Clean() for _, p in ipairs(NV_PROPS) do local v = State:Restore("NV_" .. p) if v ~= nil then pcall(function() Lighting[p] = v end) end end for a, o in pairs(atmoOrig) do if a.Parent then a.Density, a.Haze = o.Density, o.Haze end end table.clear(atmoOrig) end, false) -- ===== Fix Lag ===== local LAG_CLASSES = { ParticleEmitter = true, Trail = true, Smoke = true, Fire = true, Sparkles = true, Beam = true, BlurEffect = true, BloomEffect = true, SunRaysEffect = true, ColorCorrectionEffect = true, DepthOfFieldEffect = true, } local lagOrig = setmetatable({}, { __mode = "k" }) -- [instance] = giá trị gốc local LagJan, lagToken = Janitor.new(), 0 local function lagFix(d) if LAG_CLASSES[d.ClassName] then if lagOrig[d] == nil then lagOrig[d] = d.Enabled end d.Enabled = false elseif d:IsA("BasePart") then if lagOrig[d] == nil then lagOrig[d] = d.CastShadow end d.CastShadow = false end end State:Register("FixLag", function() lagToken += 1 local tok = lagToken pcall(function() State:Save("Quality", settings().Rendering.QualityLevel) settings().Rendering.QualityLevel = Enum.QualityLevel.Level01 end) LagJan:Add(Workspace.DescendantAdded:Connect(lagFix)) LagJan:Add(Lighting.DescendantAdded:Connect(lagFix)) task.spawn(function() local n = 0 for _, root in ipairs({ Workspace, Lighting }) do for _, d in ipairs(root:GetDescendants()) do if lagToken ~= tok then return end pcall(lagFix, d) n += 1 if n % 300 == 0 then task.wait() end -- nhường frame, không treo máy end end end) end, function() lagToken += 1 LagJan:Clean() local q = State:Restore("Quality") if q ~= nil then pcall(function() settings().Rendering.QualityLevel = q end) end local list = {} for inst, v in pairs(lagOrig) do list[#list + 1] = { inst, v } end table.clear(lagOrig) task.spawn(function() for i, it in ipairs(list) do local inst, v = it[1], it[2] if inst.Parent then pcall(function() if LAG_CLASSES[inst.ClassName] then inst.Enabled = v else inst.CastShadow = v end end) end if i % 300 == 0 then task.wait() end end end) end, false) --------------------------------------------------------------------- -- UIController --------------------------------------------------------------------- local UI = { _jan = Janitor.new() } local TABS = { { name = "Main", rows = { { "toggle", "Tele Dron", "TeleDron" }, { "toggle", "Tele Kill", "TeleKill" }, { "toggle", "Aimbot", "Aimbot" }, { "number", "Dron: cao an toàn", "DroneHeightOffset", 3, 100 }, } }, { name = "Esp", rows = { { "toggle", "Esp Line", "EspLine" }, { "toggle", "Esp Box", "EspBox" }, { "toggle", "Esp Name", "EspName" }, { "toggle", "Esp Distance", "EspDistance" }, { "toggle", "Esp Hologram", "EspHologram" }, { "toggle", "Esp Workspace", "EspWorkspace" }, } }, { name = "Khác", rows = { { "toggle", "Fly Down", "FlyDown" }, { "toggle", "Fly Dron", "FlyDron" }, { "number", "Fly Dron: độ cao", "FlyDronHeight", 1, 200 }, { "toggle", "No Clip", "NoClip" }, { "toggle", "Fly Air", "FlyAir" }, { "number", "Fly Speed", "FlySpeed", 1, 300 }, { "toggle", "Speed", "Speed" }, { "number", "Speed: giá trị", "WalkSpeed", 1, 300 }, { "toggle", "Jumping Air", "JumpingAir" }, { "toggle", "Night Vision", "NightVision" }, { "toggle", "Fix Lag", "FixLag" }, } }, } local function isPointer(i) return i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch end local function corner(inst, r) local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, r) c.Parent = inst end local function mkText(parent, class, text, size) local t = Instance.new(class) t.BackgroundTransparency = 1 t.Text = text t.TextColor3 = Color3.new(1, 1, 1) t.Font = Enum.Font.GothamMedium t.TextSize = size or 13 t.Parent = parent return t end function UI:Build() local gui = Instance.new("ScreenGui") gui.Name = "HpTeamProV1" gui.ResetOnSpawn = false gui.DisplayOrder = 10 gui.Parent = LocalPlayer:WaitForChild("PlayerGui") self._jan:Add(gui) local main = Instance.new("Frame") main.Size = UDim2.fromOffset(350, 200) main.Position = UDim2.new(0.5, -175, 0.25, 0) main.BackgroundColor3 = BG1 main.BorderSizePixel = 0 main.ClipsDescendants = true main.Parent = gui corner(main, 6) local stroke = Instance.new("UIStroke") stroke.Color = GREEN stroke.Thickness = 1.5 stroke.Parent = main -- Thanh tiêu đề (kéo thả) local bar = Instance.new("Frame") bar.Size = UDim2.new(1, 0, 0, 28) bar.BackgroundColor3 = BG2 bar.BorderSizePixel = 0 bar.Parent = main local title = mkText(bar, "TextLabel", "Hp Team Pro V1", 14) title.Size = UDim2.new(1, -70, 1, 0) title.Position = UDim2.fromOffset(10, 0) title.TextXAlignment = Enum.TextXAlignment.Left title.TextColor3 = GREEN title.Font = Enum.Font.GothamBold local function barBtn(txt, x) local b = mkText(bar, "TextButton", txt, 14) b.Size = UDim2.fromOffset(26, 20) b.Position = UDim2.new(1, x, 0, 4) b.BackgroundTransparency = 0 b.BackgroundColor3 = BG1 b.TextColor3 = GREEN corner(b, 4) return b end local btnMin, btnExit = barBtn("—", -58), barBtn("X", -30) local dragging, dragStart, startPos self._jan:Add(bar.InputBegan:Connect(function(i) if isPointer(i) then dragging, dragStart, startPos = true, i.Position, main.Position local c; c = i.Changed:Connect(function() if i.UserInputState == Enum.UserInputState.End then dragging = false c:Disconnect() end end) end end)) self._jan: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 - dragStart main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end)) -- Thanh tab local tabBar = Instance.new("Frame") tabBar.Size = UDim2.new(1, -8, 0, 24) tabBar.Position = UDim2.fromOffset(4, 30) tabBar.BackgroundTransparency = 1 tabBar.Parent = main local tl = Instance.new("UIListLayout") tl.FillDirection = Enum.FillDirection.Horizontal tl.Padding = UDim.new(0, 4) tl.Parent = tabBar local content = Instance.new("Frame") content.Size = UDim2.new(1, -8, 1, -60) content.Position = UDim2.fromOffset(4, 56) content.BackgroundTransparency = 1 content.Parent = main local pages, tabBtns, toggleRefs, numberRefs = {}, {}, {}, {} local function showTab(name) for n, p in pairs(pages) do p.Visible = (n == name) end for n, b in pairs(tabBtns) do b.BackgroundColor3 = (n == name) and GREEN or BG2 b.TextColor3 = (n == name) and BG1 or GREEN end end for _, tab in ipairs(TABS) do local tb = mkText(tabBar, "TextButton", tab.name, 13) tb.Size = UDim2.new(1 / 3, -3, 1, 0) tb.BackgroundTransparency = 0 corner(tb, 4) tabBtns[tab.name] = tb self._jan:Add(tb.MouseButton1Click:Connect(function() showTab(tab.name) end)) local page = Instance.new("ScrollingFrame") -- cuộn lên xuống tự do page.Size = UDim2.fromScale(1, 1) page.BackgroundTransparency = 1 page.BorderSizePixel = 0 page.ScrollBarThickness = 3 page.ScrollBarImageColor3 = GREEN page.AutomaticCanvasSize = Enum.AutomaticSize.Y page.CanvasSize = UDim2.new() page.Visible = false page.Parent = content local lay = Instance.new("UIListLayout") lay.Padding = UDim.new(0, 3) lay.Parent = page pages[tab.name] = page for _, r in ipairs(tab.rows) do local kind, label, key = r[1], r[2], r[3] local row = Instance.new("Frame") row.Size = UDim2.new(1, -6, 0, 26) row.BackgroundColor3 = BG2 row.BorderSizePixel = 0 row.Parent = page corner(row, 4) local lb = mkText(row, "TextLabel", label, 13) lb.Size = UDim2.new(1, -80, 1, 0) lb.Position = UDim2.fromOffset(8, 0) lb.TextXAlignment = Enum.TextXAlignment.Left if kind == "toggle" then local b = mkText(row, "TextButton", "OFF", 12) b.Size = UDim2.fromOffset(52, 20) b.Position = UDim2.new(1, -58, 0, 3) b.BackgroundTransparency = 0 corner(b, 4) toggleRefs[key] = b self._jan:Add(b.MouseButton1Click:Connect(function() State:SetEnabled(key, not State:Get(key)) end)) else local box = mkText(row, "TextBox", tostring(State.Config[key]), 12) box.Size = UDim2.fromOffset(60, 20) box.Position = UDim2.new(1, -66, 0, 3) box.BackgroundTransparency = 0 box.BackgroundColor3 = BG1 box.ClearTextOnFocus = false corner(box, 4) numberRefs[key] = box self._jan:Add(box.FocusLost:Connect(function() local n = tonumber(box.Text) if n then State:SetConfig(key, clamp(n, r[4], r[5])) end -- chỉ nhận số hợp lệ box.Text = tostring(State.Config[key]) end)) end end end showTab("Main") local function refreshToggle(name, on) local b = toggleRefs[name] if not b then return end b.Text = on and "ON" or "OFF" b.BackgroundColor3 = on and GREEN or BG1 b.TextColor3 = on and BG1 or Color3.fromRGB(160, 160, 160) end for name in pairs(toggleRefs) do refreshToggle(name, false) end -- Cụm nút Fly: lên/xuống (Fly Air, Fly Down) hoặc tăng/giảm độ cao (Fly Dron) local pad = Instance.new("Frame") pad.Size = UDim2.fromOffset(64, 150) pad.AnchorPoint = Vector2.new(1, 1) pad.Position = UDim2.new(1, -20, 1, -120) pad.BackgroundTransparency = 1 pad.Visible = false pad.Parent = gui local function padBtn(txt, y, dir) local b = mkText(pad, "TextButton", txt, 22) b.Size = UDim2.fromOffset(64, 56) b.Position = UDim2.fromOffset(0, y) b.BackgroundTransparency = 0.15 b.BackgroundColor3 = BG1 b.TextColor3 = GREEN corner(b, 8) local s = Instance.new("UIStroke") s.Color = GREEN s.Parent = b self._jan:Add(b.InputBegan:Connect(function(i) if isPointer(i) then Flight:PadPress(dir) end end)) self._jan:Add(b.InputEnded:Connect(function(i) if isPointer(i) then Flight:PadRelease(dir) end end)) end padBtn("▲", 0, 1) padBtn("▼", 94, -1) local padLabel = mkText(pad, "TextLabel", "", 12) padLabel.Size = UDim2.fromOffset(64, 30) padLabel.Position = UDim2.fromOffset(0, 60) padLabel.TextColor3 = GREEN local function refreshPad() pad.Visible = Flight.Mode ~= nil padLabel.Text = (Flight.Mode == "Dron") and ("Cao: " .. State.Config.FlyDronHeight) or "Bay" end State:OnChanged(function(name, on) refreshToggle(name, on) refreshPad() end) State:OnConfig(function(key, value) if numberRefs[key] then numberRefs[key].Text = tostring(value) end refreshPad() end) -- Thu gọn / mở rộng local collapsed = false self._jan:Add(btnMin.MouseButton1Click:Connect(function() collapsed = not collapsed tabBar.Visible, content.Visible = not collapsed, not collapsed main.Size = collapsed and UDim2.fromOffset(350, 28) or UDim2.fromOffset(350, 200) btnMin.Text = collapsed and "+" or "—" end)) self._jan:Add(btnExit.MouseButton1Click:Connect(function() Hp.Shutdown() end)) end --------------------------------------------------------------------- -- Khởi động / tắt toàn bộ --------------------------------------------------------------------- Hp = { State = State, Scanner = Scanner, Combat = Combat, Esp = Esp } function Hp.Shutdown() for name in pairs(State.Features) do State:SetEnabled(name, false) end -- tắt hết, khôi phục snapshot Esp:ClearAll() Esp._jan:Clean() Scanner._jan:Clean() UI._jan:Clean() Hp = nil end Scanner:Init() Esp:Init() UI:Build()