编辑/修改脚本
取消修改
脚本名称
脚本代码
-- ============================================================================= -- NNB 专属终极版:摇杆全自动连跳 + 悬浮窗面板 -- ============================================================================= local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local LocalPlayer = game:GetService("Players").LocalPlayer -- 暴力清理旧界面 local OldUI = game:GetService("CoreGui"):FindFirstChild("NNB_Helper_UI") if OldUI then OldUI:Destroy() end local Orion = Instance.new("ScreenGui") Orion.Name = "NNB_Helper_UI" Orion.ResetOnSpawn = false Orion.ZIndexBehavior = Enum.ZIndexBehavior.Sibling Orion.Parent = game:GetService("CoreGui") local ScriptRunning = true local isAutoBhopEnabled = false local bhopBoost = 25 -- NNB需要更大的初始推力,调高到25 local canJump = true local function Create(Name, Properties) local Object = Instance.new(Name) for i, v in pairs(Properties or {}) do Object[i] = v end return Object end -- ============================================================================= -- UI 界面构建 -- ============================================================================= local MainWindow = Create("Frame", { Parent = Orion, Position = UDim2.new(0.5, -150, 0.5, -100), Size = UDim2.new(0, 300, 0, 200), BackgroundColor3 = Color3.fromRGB(25, 25, 25), BorderSizePixel = 0, Active = true }) Create("UICorner", {CornerRadius = UDim.new(0, 8), Parent = MainWindow}) Create("UIStroke", {Color = Color3.fromRGB(60, 60, 60), Thickness = 1.2, Parent = MainWindow}) -- 悬浮球 (默认隐藏) local FloatBtn = Create("TextButton", { Parent = Orion, Position = UDim2.new(0, 20, 0.5, -25), Size = UDim2.new(0, 50, 0, 50), BackgroundColor3 = Color3.fromRGB(30, 30, 30), Text = "菜单", TextColor3 = Color3.fromRGB(9, 149, 98), TextSize = 14, Font = Enum.Font.GothamBold, Visible = false }) Create("UICorner", {CornerRadius = UDim.new(1, 0), Parent = FloatBtn}) Create("UIStroke", {Color = Color3.fromRGB(9, 149, 98), Thickness = 2, Parent = FloatBtn}) -- 拖拽逻辑支持 local function MakeDraggable(UIElement) local Dragging, DragInput, MousePos, FramePos UIElement.InputBegan:Connect(function(Input) if Input.UserInputType == Enum.UserInputType.MouseButton1 or Input.UserInputType == Enum.UserInputType.Touch then Dragging = true MousePos = Input.Position FramePos = UIElement.Position Input.Changed:Connect(function() if Input.UserInputState == Enum.UserInputState.End then Dragging = false end end) end end) UIElement.InputChanged:Connect(function(Input) if Input.UserInputType == Enum.UserInputType.MouseMovement or Input.UserInputType == Enum.UserInputType.Touch then DragInput = Input end end) UserInputService.InputChanged:Connect(function(Input) if Input == DragInput and Dragging then local Delta = Input.Position - MousePos UIElement.Position = UDim2.new(FramePos.X.Scale, FramePos.X.Offset + Delta.X, FramePos.Y.Scale, FramePos.Y.Offset + Delta.Y) end end) end MakeDraggable(MainWindow) MakeDraggable(FloatBtn) -- 顶部标题栏 & 隐藏按钮 local TopBar = Create("Frame", { Parent = MainWindow, Size = UDim2.new(1, 0, 0, 35), BackgroundColor3 = Color3.fromRGB(35, 35, 35) }) Create("UICorner", {CornerRadius = UDim.new(0, 8), Parent = TopBar}) Create("TextLabel", { Parent = TopBar, Text = " NNB 终极身法系统", Size = UDim2.new(0, 200, 1, 0), TextColor3 = Color3.fromRGB(255, 255, 255), TextSize = 14, Font = Enum.Font.GothamBold, BackgroundTransparency = 1, TextXAlignment = Enum.TextXAlignment.Left }) local HideBtn = Create("TextButton", { Parent = TopBar, Position = UDim2.new(1, -65, 0, 5), Size = UDim2.new(0, 60, 0, 25), BackgroundColor3 = Color3.fromRGB(60, 60, 60), Text = "隐藏", TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.GothamBold, TextSize = 12 }) Create("UICorner", {CornerRadius = UDim.new(0, 4), Parent = HideBtn}) HideBtn.MouseButton1Click:Connect(function() MainWindow.Visible = false FloatBtn.Visible = true end) FloatBtn.MouseButton1Click:Connect(function() FloatBtn.Visible = false MainWindow.Visible = true end) -- 开关与按钮容器 local Container = Create("Frame", { Parent = MainWindow, Position = UDim2.new(0, 10, 0, 45), Size = UDim2.new(1, -20, 1, -55), BackgroundTransparency = 1 }) local ListLayout = Create("UIListLayout", { Parent = Container, Padding = UDim.new(0, 8) }) -- 1. 连跳开关 local BhopBtn = Create("TextButton", { Parent = Container, Size = UDim2.new(1, 0, 0, 45), BackgroundColor3 = Color3.fromRGB(45, 45, 45), Text = "全自动连跳: 关\n(推摇杆自动跳)", TextColor3 = Color3.fromRGB(200, 200, 200), Font = Enum.Font.GothamBold, TextSize = 13 }) Create("UICorner", {CornerRadius = UDim.new(0, 6), Parent = BhopBtn}) BhopBtn.MouseButton1Click:Connect(function() isAutoBhopEnabled = not isAutoBhopEnabled if isAutoBhopEnabled then BhopBtn.Text = "全自动连跳: 运行中\n(推摇杆自动跳)" BhopBtn.BackgroundColor3 = Color3.fromRGB(9, 149, 98) BhopBtn.TextColor3 = Color3.fromRGB(255, 255, 255) else BhopBtn.Text = "全自动连跳: 关\n(推摇杆自动跳)" BhopBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 45) BhopBtn.TextColor3 = Color3.fromRGB(200, 200, 200) end end) -- 2. 彻底退出按钮 local ExitBtn = Create("TextButton", { Parent = Container, Size = UDim2.new(1, 0, 0, 35), BackgroundColor3 = Color3.fromRGB(180, 50, 50), Text = "彻底退出程序", TextColor3 = Color3.fromRGB(255, 255, 255), Font = Enum.Font.GothamBold, TextSize = 13 }) Create("UICorner", {CornerRadius = UDim.new(0, 6), Parent = ExitBtn}) ExitBtn.MouseButton1Click:Connect(function() ScriptRunning = false isAutoBhopEnabled = false Orion:Destroy() end) -- ============================================================================= -- 核心引擎:纯物理检测自动连跳 (无视动画限制) -- ============================================================================= RunService.Heartbeat:Connect(function() if not ScriptRunning or not isAutoBhopEnabled then return end local character = LocalPlayer.Character local humanoid = character and character:FindFirstChild("Humanoid") local hrp = character and character:FindFirstChild("HumanoidRootPart") if character and humanoid and hrp and humanoid.Health > 0 then -- 只要玩家推动了方向摇杆 (有移动意图) local moveDir = humanoid.MoveDirection if moveDir.Magnitude > 0 then -- 严苛的落地检测:不看动画,只看物理引擎判定脚是否沾地 local onGround = (humanoid.FloorMaterial ~= Enum.Material.Air) or (humanoid:GetState() == Enum.HumanoidStateType.Landed) if onGround and canJump then -- 双重起跳保险 (防止游戏禁用了 Jump 属性) humanoid.Jump = true humanoid:ChangeState(Enum.HumanoidStateType.Jumping) canJump = false -- 给予向前滑行的叠加动量 local currentVel = hrp.AssemblyLinearVelocity hrp.AssemblyLinearVelocity = Vector3.new( currentVel.X + (moveDir.X * bhopBoost), currentVel.Y, -- 保持原有的跳跃高度 currentVel.Z + (moveDir.Z * bhopBoost) ) -- 冷却 0.1 秒,维持游戏引擎能识别的连跳节奏 task.delay(0.1, function() canJump = true end) end else -- 摇杆松开,重置跳跃许可 canJump = true end end end)
保存修改