--[[ Hp Team Pro V1 - LocalScript Đặt tại: StarterPlayer > StarterPlayerScripts (hoặc StarterGui) Chỉ dùng để phát triển / kiểm thử trong game do bạn tự xây dựng. ]] --================================================================== -- SECTION 1: SERVICES --================================================================== local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Workspace = game:GetService("Workspace") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") --================================================================== -- SECTION 2: CẤU HÌNH (CHỈNH LẠI KHI NỐI VÀO GAME THẬT) --================================================================== local CONFIG = { SCAN_RANGE = 150, -- phạm vi quét (studs) NPC_CONTAINER = Workspace, -- thư mục chứa NPC/Mob, ví dụ Workspace:FindFirstChild("Enemies") TARGET_REFRESH = 0.25, -- chu kỳ làm mới danh sách mục tiêu (giây) ATTACK_INTERVAL = 0.15, -- khoảng cách giữa 2 lần đánh/bắn (giây) TELE_BEHIND_DISTANCE = 3, -- đứng sau lưng mục tiêu bao nhiêu studs khi Tele Kill REQUIRE_LINE_OF_SIGHT = false, -- true: Auto Bắn/Aimbot chỉ chọn mục tiêu không bị vật cản che AIM_MAGIC_WINDOW = 0.3, -- thời gian (giây) giữ ghim hướng sau mỗi thao tác bắn DAMAGE_REMOTE_NAME = nil, -- tên RemoteEvent trong ReplicatedStorage, ví dụ "DealDamage". nil = chỉ dùng Tool:Activate() GHOST_REMOTE_NAME = nil, -- tên RemoteEvent báo trạng thái Ghost lên Server. nil = chỉ đặt Attribute GHOST_ATTRIBUTE = "Ghost", -- Server/AI của Mob cần đọc Attribute này để bỏ qua người chơi DEFAULT_WALKSPEED = 16, SPEED_MIN = 8, SPEED_MAX = 200, SPEED_STEP = 8, SPEED_DEFAULT_ON = 50, FLY_SPEED_MIN = 10, FLY_SPEED_MAX = 300, FLY_SPEED_STEP = 10, FLY_SPEED_DEFAULT = 60, } --================================================================== -- SECTION 3: TRẠNG THÁI & QUẢN LÝ KẾT NỐI --================================================================== local allConnections = {} -- kết nối toàn cục (UI, input) local featureConnections = {} -- [tênChứcNăng] = {connections} local featureEnabled = {} -- [tênChứcNăng] = bool local featureStop = {} -- [tênChứcNăng] = hàm dọn dẹp riêng local destroyed = false local state = { speedValue = CONFIG.SPEED_DEFAULT_ON, flySpeed = CONFIG.FLY_SPEED_DEFAULT, flyVertical = 0, aimMagicUntil = 0, targets = {}, lastRefresh = 0, } local function track(conn) table.insert(allConnections, conn) return conn end local function trackFeature(name, conn) featureConnections[name] = featureConnections[name] or {} table.insert(featureConnections[name], conn) return conn end local function clearFeatureConnections(name) local list = featureConnections[name] if list then for _, c in ipairs(list) do if c.Connected then c:Disconnect() end end featureConnections[name] = nil end end --================================================================== -- SECTION 4: HÀM TIỆN ÍCH NHÂN VẬT / MỤC TIÊU --================================================================== local function getCharacter() return player.Character end local function getRoot() local char = getCharacter() return char and char:FindFirstChild("HumanoidRootPart") end local function getHumanoid() local char = getCharacter() return char and char:FindFirstChildOfClass("Humanoid") end local function findRemote(name) if not name then return nil end local r = ReplicatedStorage:FindFirstChild(name, true) if r and (r:IsA("RemoteEvent") or r:IsA("RemoteFunction")) then return r end return nil end local function isValidTarget(model) if not model:IsA("Model") then return nil end if model == player.Character then return nil end if Players:GetPlayerFromCharacter(model) then return nil end -- loại bỏ mọi người chơi local hum = model:FindFirstChildOfClass("Humanoid") if not hum or hum.Health <= 0 then return nil end local root = model.PrimaryPart or model:FindFirstChild("HumanoidRootPart") if not root then return nil end return hum, root end local function hasLineOfSight(targetModel, targetRoot) local cam = Workspace.CurrentCamera local params = RaycastParams.new() params.FilterType = Enum.RaycastFilterType.Exclude params.FilterDescendantsInstances = { getCharacter() } local origin = cam.CFrame.Position local result = Workspace:Raycast(origin, targetRoot.Position - origin, params) return result == nil or result.Instance:IsDescendantOf(targetModel) end -- Làm mới danh sách mục tiêu trong phạm vi quét local function refreshTargets() local root = getRoot() local list = {} if root and CONFIG.NPC_CONTAINER then for _, inst in ipairs(CONFIG.NPC_CONTAINER:GetDescendants()) do if inst:IsA("Humanoid") then local model = inst.Parent if model then local hum, tRoot = isValidTarget(model) if hum and tRoot then local dist = (tRoot.Position - root.Position).Magnitude if dist <= CONFIG.SCAN_RANGE then table.insert(list, { model = model, humanoid = hum, root = tRoot, dist = dist }) end end end end end table.sort(list, function(a, b) return a.dist < b.dist end) end state.targets = list end local function getTargets(dt) local now = os.clock() if now - state.lastRefresh >= CONFIG.TARGET_REFRESH then state.lastRefresh = now refreshTargets() end return state.targets end local function getNearestTarget() local list = getTargets() local root = getRoot() for _, t in ipairs(list) do if t.humanoid.Health > 0 and t.root.Parent and root then t.dist = (t.root.Position - root.Position).Magnitude if t.dist <= CONFIG.SCAN_RANGE then if not CONFIG.REQUIRE_LINE_OF_SIGHT or hasLineOfSight(t.model, t.root) then return t end end end end return nil end local function attack(target) local char = getCharacter() if not char then return end local tool = char:FindFirstChildOfClass("Tool") if tool then pcall(function() tool:Activate() end) end local remote = findRemote(CONFIG.DAMAGE_REMOTE_NAME) if remote and target and remote:IsA("RemoteEvent") then pcall(function() remote:FireServer(target.model) end) end end --================================================================== -- SECTION 5: GIAO DIỆN (UI) --================================================================== local COLOR_BG = Color3.fromHex("0C0E0C") local COLOR_BG2 = Color3.fromHex("141814") local COLOR_GREEN = Color3.fromHex("00FF66") local COLOR_OFF = Color3.fromHex("2A302A") local old = playerGui:FindFirstChild("HpTeamProV1") if old then old:Destroy() end local gui = Instance.new("ScreenGui") gui.Name = "HpTeamProV1" gui.ResetOnSpawn = false gui.IgnoreGuiInset = true gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling gui.DisplayOrder = 100 gui.Parent = playerGui local function make(class, props, parent) local obj = Instance.new(class) for k, v in pairs(props) do obj[k] = v end obj.Parent = parent return obj end local function stroke(parent, thickness) return make("UIStroke", { Color = COLOR_GREEN, Thickness = thickness or 1.5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }, parent) end -- Lớp phủ ESP (không chặn input) local overlay = make("Frame", { Name = "EspOverlay", Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Active = false, ZIndex = 1, }, gui) -- Khung menu chính local main = make("Frame", { Name = "Main", Size = UDim2.fromOffset(300, 360), Position = UDim2.new(0.5, -150, 0.5, -180), BackgroundColor3 = COLOR_BG, BorderSizePixel = 0, Active = true, ZIndex = 10, }, gui) make("UICorner", { CornerRadius = UDim.new(0, 8) }, main) stroke(main, 2) local titleBar = make("Frame", { Name = "TitleBar", Size = UDim2.new(1, 0, 0, 34), BackgroundColor3 = COLOR_BG2, BorderSizePixel = 0, ZIndex = 11, }, main) make("UICorner", { CornerRadius = UDim.new(0, 8) }, titleBar) make("TextLabel", { Size = UDim2.new(1, -80, 1, 0), Position = UDim2.fromOffset(10, 0), BackgroundTransparency = 1, Text = "Hp Team Pro V1", TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 16, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 12, }, titleBar) local btnMin = make("TextButton", { Size = UDim2.fromOffset(28, 24), Position = UDim2.new(1, -66, 0, 5), BackgroundColor3 = COLOR_OFF, Text = "-", TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 18, ZIndex = 12, AutoButtonColor = true, }, titleBar) make("UICorner", { CornerRadius = UDim.new(0, 5) }, btnMin) local btnClose = make("TextButton", { Size = UDim2.fromOffset(28, 24), Position = UDim2.new(1, -34, 0, 5), BackgroundColor3 = Color3.fromRGB(120, 20, 20), Text = "X", TextColor3 = Color3.new(1, 1, 1), Font = Enum.Font.GothamBold, TextSize = 14, ZIndex = 12, AutoButtonColor = true, }, titleBar) make("UICorner", { CornerRadius = UDim.new(0, 5) }, btnClose) -- Thân menu (ẩn khi thu nhỏ) local body = make("Frame", { Name = "Body", Size = UDim2.new(1, 0, 1, -34), Position = UDim2.fromOffset(0, 34), BackgroundTransparency = 1, ZIndex = 11, }, main) local tabBar = make("Frame", { Size = UDim2.new(1, -16, 0, 30), Position = UDim2.fromOffset(8, 6), BackgroundTransparency = 1, ZIndex = 12, }, body) make("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder, }, tabBar) local pages = {} local tabButtons = {} local function createPage(name) local page = make("ScrollingFrame", { Name = name, Size = UDim2.new(1, -16, 1, -48), Position = UDim2.fromOffset(8, 42), BackgroundColor3 = COLOR_BG2, BorderSizePixel = 0, ScrollBarThickness = 4, ScrollBarImageColor3 = COLOR_GREEN, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, Visible = false, ZIndex = 12, ScrollingDirection = Enum.ScrollingDirection.Y, }, body) make("UICorner", { CornerRadius = UDim.new(0, 6) }, page) make("UIListLayout", { Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }, page) make("UIPadding", { PaddingTop = UDim.new(0, 6), PaddingBottom = UDim.new(0, 6), PaddingLeft = UDim.new(0, 6), PaddingRight = UDim.new(0, 10), }, page) pages[name] = page return page end local function selectTab(name) for n, p in pairs(pages) do p.Visible = (n == name) end for n, b in pairs(tabButtons) do b.BackgroundColor3 = (n == name) and COLOR_GREEN or COLOR_OFF b.TextColor3 = (n == name) and COLOR_BG or COLOR_GREEN end end local function createTab(name, order) local b = make("TextButton", { Size = UDim2.new(0.333, -4, 1, 0), BackgroundColor3 = COLOR_OFF, Text = name, TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 14, LayoutOrder = order, ZIndex = 13, AutoButtonColor = true, }, tabBar) make("UICorner", { CornerRadius = UDim.new(0, 6) }, b) tabButtons[name] = b track(b.MouseButton1Click:Connect(function() selectTab(name) end)) return createPage(name) end local pageMain = createTab("Main", 1) local pageEsp = createTab("Esp", 2) local pageOther = createTab("Khác", 3) -- Hàng bật/tắt local toggleButtons = {} local function addToggle(page, label, name, order) local btn = make("TextButton", { Size = UDim2.new(1, 0, 0, 32), BackgroundColor3 = COLOR_OFF, Text = label .. " [TẮT]", TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamMedium, TextSize = 14, LayoutOrder = order, ZIndex = 13, AutoButtonColor = true, }, page) make("UICorner", { CornerRadius = UDim.new(0, 6) }, btn) toggleButtons[name] = { button = btn, label = label } return btn end local function refreshToggleVisual(name) local t = toggleButtons[name] if not t then return end local on = featureEnabled[name] == true t.button.BackgroundColor3 = on and COLOR_GREEN or COLOR_OFF t.button.TextColor3 = on and COLOR_BG or COLOR_GREEN t.button.Text = t.label .. (on and " [BẬT]" or " [TẮT]") end -- Hàng tăng/giảm giá trị local function addStepper(page, label, order, getValue, setValue, minV, maxV, step) local row = make("Frame", { Size = UDim2.new(1, 0, 0, 32), BackgroundColor3 = COLOR_OFF, LayoutOrder = order, ZIndex = 13, }, page) make("UICorner", { CornerRadius = UDim.new(0, 6) }, row) local lbl = make("TextLabel", { Size = UDim2.new(1, -76, 1, 0), Position = UDim2.fromOffset(8, 0), BackgroundTransparency = 1, Text = label .. ": " .. tostring(getValue()), TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamMedium, TextSize = 14, TextXAlignment = Enum.TextXAlignment.Left, ZIndex = 14, }, row) local function mk(text, x) local b = make("TextButton", { Size = UDim2.fromOffset(28, 24), Position = UDim2.new(1, x, 0.5, -12), BackgroundColor3 = COLOR_BG, Text = text, TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 16, ZIndex = 14, }, row) make("UICorner", { CornerRadius = UDim.new(0, 5) }, b) return b end local minus, plus = mk("-", -68), mk("+", -36) track(minus.MouseButton1Click:Connect(function() setValue(math.clamp(getValue() - step, minV, maxV)) lbl.Text = label .. ": " .. tostring(getValue()) end)) track(plus.MouseButton1Click:Connect(function() setValue(math.clamp(getValue() + step, minV, maxV)) lbl.Text = label .. ": " .. tostring(getValue()) end)) end -- Nút Fly lên/xuống (chỉ hiện khi Fly bật) local flyPanel = make("Frame", { Name = "FlyPanel", Size = UDim2.fromOffset(60, 130), Position = UDim2.new(1, -80, 0.5, -65), BackgroundTransparency = 1, Visible = false, ZIndex = 20, }, gui) local function flyButton(text, y, dir) local b = make("TextButton", { Size = UDim2.fromOffset(60, 58), Position = UDim2.fromOffset(0, y), BackgroundColor3 = COLOR_BG, Text = text, TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 28, ZIndex = 21, }, flyPanel) make("UICorner", { CornerRadius = UDim.new(0, 8) }, b) stroke(b, 2) track(b.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then state.flyVertical = dir local ended ended = input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then if state.flyVertical == dir then state.flyVertical = 0 end ended:Disconnect() end end) end end)) return b end flyButton("▲", 0, 1) flyButton("▼", 72, -1) --================================================================== -- SECTION 6: KÉO THẢ & THU NHỎ & THOÁT --================================================================== do local dragging, dragInput, dragStart, startPos = false, nil, nil, nil track(titleBar.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = main.Position local c c = input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false c:Disconnect() end end) end end)) track(titleBar.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end)) track(UserInputService.InputChanged:Connect(function(input) if dragging and input == dragInput then local delta = input.Position - dragStart main.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end)) end local minimized = false track(btnMin.MouseButton1Click:Connect(function() minimized = not minimized body.Visible = not minimized main.Size = minimized and UDim2.fromOffset(300, 34) or UDim2.fromOffset(300, 360) btnMin.Text = minimized and "+" or "-" end)) --================================================================== -- SECTION 7: MAIN - TELE KILL / AIMBOT / AIM MAGIC / AUTO BẮN --================================================================== local function setTeleKill(on) clearFeatureConnections("TeleKill") if not on then return end local acc = 0 trackFeature("TeleKill", RunService.Heartbeat:Connect(function(dt) acc += dt if acc < CONFIG.ATTACK_INTERVAL then return end acc = 0 local root = getRoot() local target = getNearestTarget() if root and target then local behind = target.root.CFrame * CFrame.new(0, 0, CONFIG.TELE_BEHIND_DISTANCE) root.CFrame = CFrame.lookAt(behind.Position, target.root.Position) attack(target) end end)) end local function setAimbot(on) clearFeatureConnections("Aimbot") if not on then return end trackFeature("Aimbot", RunService.RenderStepped:Connect(function() local cam = Workspace.CurrentCamera local target = getNearestTarget() if cam and target then cam.CFrame = CFrame.lookAt(cam.CFrame.Position, target.root.Position) end end)) end local function setAimMagic(on) clearFeatureConnections("AimMagic") state.aimMagicUntil = 0 if not on then return end trackFeature("AimMagic", UserInputService.InputBegan:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then state.aimMagicUntil = os.clock() + CONFIG.AIM_MAGIC_WINDOW end end)) trackFeature("AimMagic", RunService.RenderStepped:Connect(function() if os.clock() > state.aimMagicUntil then return end local cam = Workspace.CurrentCamera local target = getNearestTarget() if cam and target then cam.CFrame = CFrame.lookAt(cam.CFrame.Position, target.root.Position) end end)) end local function setAutoShoot(on) clearFeatureConnections("AutoShoot") if not on then return end local acc = 0 trackFeature("AutoShoot", RunService.Heartbeat:Connect(function(dt) acc += dt if acc < CONFIG.ATTACK_INTERVAL then return end acc = 0 local target = getNearestTarget() if target then attack(target) end -- không khóa camera end)) end --================================================================== -- SECTION 8: ESP (Line / Box / Name / Distance / Hologram) --================================================================== local espFlags = { Line = false, Box = false, Name = false, Distance = false, Hologram = false } local espObjects = {} -- [model] = { line, box, name, dist, highlight } local function createEspObject(model) local obj = {} obj.line = make("Frame", { BackgroundColor3 = COLOR_GREEN, BorderSizePixel = 0, AnchorPoint = Vector2.new(0.5, 0.5), Visible = false, ZIndex = 2, }, overlay) obj.box = make("Frame", { BackgroundTransparency = 1, BorderSizePixel = 0, Visible = false, ZIndex = 2, }, overlay) make("UIStroke", { Color = COLOR_GREEN, Thickness = 1.5 }, obj.box) obj.name = make("TextLabel", { BackgroundTransparency = 1, TextColor3 = COLOR_GREEN, Font = Enum.Font.GothamBold, TextSize = 13, TextStrokeTransparency = 0.4, Size = UDim2.fromOffset(140, 16), AnchorPoint = Vector2.new(0.5, 1), Visible = false, ZIndex = 3, }, overlay) obj.dist = make("TextLabel", { BackgroundTransparency = 1, TextColor3 = Color3.new(1, 1, 1), Font = Enum.Font.Gotham, TextSize = 12, TextStrokeTransparency = 0.4, Size = UDim2.fromOffset(100, 14), AnchorPoint = Vector2.new(0.5, 0), Visible = false, ZIndex = 3, }, overlay) obj.highlight = make("Highlight", { Adornee = model, FillColor = COLOR_GREEN, FillTransparency = 0.6, OutlineColor = COLOR_GREEN, DepthMode = Enum.HighlightDepthMode.AlwaysOnTop, Enabled = false, }, Workspace.CurrentCamera) return obj end local function destroyEspObject(obj) for _, key in ipairs({ "line", "box", "name", "dist", "highlight" }) do if obj[key] then obj[key]:Destroy() end end end local function clearAllEsp() for model, obj in pairs(espObjects) do destroyEspObject(obj) espObjects[model] = nil end end local function anyEspOn() for _, v in pairs(espFlags) do if v then return true end end return false end local function hideEsp(obj) obj.line.Visible = false obj.box.Visible = false obj.name.Visible = false obj.dist.Visible = false obj.highlight.Enabled = false end local function updateEsp() local cam = Workspace.CurrentCamera local root = getRoot() if not cam or not root then return end local targets = getTargets() local alive = {} local viewport = cam.ViewportSize for _, t in ipairs(targets) do if t.humanoid.Health > 0 and t.root.Parent then alive[t.model] = true local obj = espObjects[t.model] if not obj then obj = createEspObject(t.model) espObjects[t.model] = obj end local dist = (t.root.Position - root.Position).Magnitude local cf, size = t.model:GetBoundingBox() local screenPos, onScreen = cam:WorldToViewportPoint(cf.Position) obj.highlight.Enabled = espFlags.Hologram if onScreen and screenPos.Z > 0 then -- Box: chiếu 8 góc bounding box local minX, minY, maxX, maxY = math.huge, math.huge, -math.huge, -math.huge for x = -1, 1, 2 do for y = -1, 1, 2 do for z = -1, 1, 2 do local corner = cf * CFrame.new(size.X / 2 * x, size.Y / 2 * y, size.Z / 2 * z) local p = cam:WorldToViewportPoint(corner.Position) minX, minY = math.min(minX, p.X), math.min(minY, p.Y) maxX, maxY = math.max(maxX, p.X), math.max(maxY, p.Y) end end end obj.box.Visible = espFlags.Box if espFlags.Box then obj.box.Position = UDim2.fromOffset(minX, minY) obj.box.Size = UDim2.fromOffset(maxX - minX, maxY - minY) end obj.name.Visible = espFlags.Name if espFlags.Name then obj.name.Text = t.model.Name obj.name.Position = UDim2.fromOffset((minX + maxX) / 2, minY - 2) end obj.dist.Visible = espFlags.Distance if espFlags.Distance then obj.dist.Text = string.format("%.0fm", dist) obj.dist.Position = UDim2.fromOffset((minX + maxX) / 2, maxY + 2) end obj.line.Visible = espFlags.Line if espFlags.Line then local from = Vector2.new(viewport.X / 2, 0) local to = Vector2.new(screenPos.X, screenPos.Y) local delta = to - from obj.line.Size = UDim2.fromOffset(delta.Magnitude, 1.5) obj.line.Position = UDim2.fromOffset((from.X + to.X) / 2, (from.Y + to.Y) / 2) obj.line.Rotation = math.deg(math.atan2(delta.Y, delta.X)) end else obj.line.Visible = false obj.box.Visible = false obj.name.Visible = false obj.dist.Visible = false end end end -- Dọn các mục tiêu đã biến mất / ra khỏi phạm vi for model, obj in pairs(espObjects) do if not alive[model] then destroyEspObject(obj) espObjects[model] = nil end end end local function refreshEspLoop() clearFeatureConnections("EspLoop") if anyEspOn() then trackFeature("EspLoop", RunService.RenderStepped:Connect(updateEsp)) else clearAllEsp() end end local function setEspFlag(flag) return function(on) espFlags[flag] = on refreshEspLoop() end end --================================================================== -- SECTION 9: KHÁC - NO CLIP / FLY / SPEED / JUMP AIR / GHOST --================================================================== local noclipOriginal = {} local function setNoClip(on) clearFeatureConnections("NoClip") if on then trackFeature("NoClip", RunService.Stepped:Connect(function() local char = getCharacter() if not char then return end for _, part in ipairs(char:GetDescendants()) do if part:IsA("BasePart") and part.CanCollide then noclipOriginal[part] = true part.CanCollide = false end end end)) else for part in pairs(noclipOriginal) do if part and part.Parent then part.CanCollide = true end noclipOriginal[part] = nil end end end local flyBV, flyBG local function stopFlyObjects() if flyBV then flyBV:Destroy() flyBV = nil end if flyBG then flyBG:Destroy() flyBG = nil end local hum = getHumanoid() if hum then hum.PlatformStand = false end end local function setFly(on) clearFeatureConnections("Fly") stopFlyObjects() state.flyVertical = 0 flyPanel.Visible = on if not on then return end local root = getRoot() local hum = getHumanoid() if not root or not hum then return end flyBV = make("BodyVelocity", { MaxForce = Vector3.new(1e6, 1e6, 1e6), Velocity = Vector3.zero }, root) flyBG = make("BodyGyro", { MaxTorque = Vector3.new(1e6, 1e6, 1e6), P = 1e4, CFrame = root.CFrame }, root) hum.PlatformStand = true trackFeature("Fly", RunService.RenderStepped:Connect(function() local cam = Workspace.CurrentCamera local h = getHumanoid() if not flyBV or not flyBG or not cam or not h then return end local move = h.MoveDirection * state.flySpeed local vertical = Vector3.new(0, state.flyVertical * state.flySpeed, 0) flyBV.Velocity = move + vertical local look = cam.CFrame.LookVector flyBG.CFrame = CFrame.lookAt(Vector3.zero, Vector3.new(look.X, 0, look.Z)) end)) end local function setSpeed(on) clearFeatureConnections("Speed") local hum = getHumanoid() if on then trackFeature("Speed", RunService.Heartbeat:Connect(function() local h = getHumanoid() if h then h.WalkSpeed = state.speedValue end end)) elseif hum then hum.WalkSpeed = CONFIG.DEFAULT_WALKSPEED end end local function setJumpAir(on) clearFeatureConnections("JumpAir") if not on then return end trackFeature("JumpAir", UserInputService.JumpRequest:Connect(function() local h = getHumanoid() if h then h:ChangeState(Enum.HumanoidStateType.Jumping) end end)) end local ghostSavedTransparency = {} local function setGhost(on) clearFeatureConnections("Ghost") local char = getCharacter() local remote = findRemote(CONFIG.GHOST_REMOTE_NAME) local function apply(c, state_on) if not c then return end c:SetAttribute(CONFIG.GHOST_ATTRIBUTE, state_on) if remote and remote:IsA("RemoteEvent") then pcall(function() remote:FireServer(state_on) end) end end if on then apply(char, true) -- Giữ trạng thái khi nhân vật hồi sinh trackFeature("Ghost", player.CharacterAdded:Connect(function(c) c:WaitForChild("HumanoidRootPart", 5) apply(c, true) end)) else apply(char, false) end end --================================================================== -- SECTION 10: ĐĂNG KÝ CHỨC NĂNG & NỐI VÀO UI --================================================================== local featureHandlers = { TeleKill = setTeleKill, Aimbot = setAimbot, AimMagic = setAimMagic, AutoShoot = setAutoShoot, EspLine = setEspFlag("Line"), EspBox = setEspFlag("Box"), EspName = setEspFlag("Name"), EspDistance = setEspFlag("Distance"), EspHologram = setEspFlag("Hologram"), NoClip = setNoClip, Fly = setFly, Speed = setSpeed, JumpAir = setJumpAir, Ghost = setGhost, } local function setFeature(name, on) if destroyed then return end featureEnabled[name] = on local handler = featureHandlers[name] if handler then local ok, err = pcall(handler, on) if not ok then warn("[HpTeamProV1] Lỗi chức năng " .. name .. ": " .. tostring(err)) featureEnabled[name] = false end end refreshToggleVisual(name) end local function bindToggle(page, label, name, order) local btn = addToggle(page, label, name, order) track(btn.MouseButton1Click:Connect(function() setFeature(name, not featureEnabled[name]) end)) end -- Tab Main bindToggle(pageMain, "Tele Kill", "TeleKill", 1) bindToggle(pageMain, "Aimbot", "Aimbot", 2) bindToggle(pageMain, "Aim Magic", "AimMagic", 3) bindToggle(pageMain, "Auto Bắn", "AutoShoot", 4) -- Tab Esp bindToggle(pageEsp, "Esp Line", "EspLine", 1) bindToggle(pageEsp, "Esp Box", "EspBox", 2) bindToggle(pageEsp, "Esp Name", "EspName", 3) bindToggle(pageEsp, "Esp Distance", "EspDistance", 4) bindToggle(pageEsp, "Esp Hologram", "EspHologram", 5) -- Tab Khác bindToggle(pageOther, "No Clip", "NoClip", 1) bindToggle(pageOther, "Fly Air", "Fly", 2) addStepper(pageOther, "Fly Speed", 3, function() return state.flySpeed end, function(v) state.flySpeed = v end, CONFIG.FLY_SPEED_MIN, CONFIG.FLY_SPEED_MAX, CONFIG.FLY_SPEED_STEP) bindToggle(pageOther, "Speed", "Speed", 4) addStepper(pageOther, "Tốc độ chạy", 5, function() return state.speedValue end, function(v) state.speedValue = v end, CONFIG.SPEED_MIN, CONFIG.SPEED_MAX, CONFIG.SPEED_STEP) bindToggle(pageOther, "Jumping Air", "JumpAir", 6) bindToggle(pageOther, "Ghost", "Ghost", 7) selectTab("Main") --================================================================== -- SECTION 11: XỬ LÝ HỒI SINH --================================================================== track(player.CharacterAdded:Connect(function(char) char:WaitForChild("HumanoidRootPart", 5) if featureEnabled.Fly then task.wait(0.2) setFly(true) end if featureEnabled.NoClip then noclipOriginal = {} end end)) --================================================================== -- SECTION 12: THOÁT - HỦY GUI & TẮT TOÀN BỘ TRẠNG THÁI --================================================================== local function shutdown() if destroyed then return end for name in pairs(featureHandlers) do if featureEnabled[name] then pcall(featureHandlers[name], false) featureEnabled[name] = false end end destroyed = true for name in pairs(featureConnections) do clearFeatureConnections(name) end clearAllEsp() stopFlyObjects() local hum = getHumanoid() if hum then hum.WalkSpeed = CONFIG.DEFAULT_WALKSPEED end for _, c in ipairs(allConnections) do if c.Connected then c:Disconnect() end end table.clear(allConnections) state.targets = {} gui:Destroy() end -- Kết nối riêng (không đưa vào allConnections trước khi shutdown tự ngắt) btnClose.MouseButton1Click:Connect(shutdown)