编辑/修改脚本
取消修改
脚本名称
脚本代码
-- LocalScript 放入 StarterPlayerScripts 中 local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local Players = game:GetService("Players") local player = Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") -- =================【核心开关与配置】================= local featureEnabled = true -- true 为开启检测,false 为关闭检测 local SLIDE_KEY = Enum.KeyCode.C -- 你的滑铲按键 local JUMP_INTERVAL = 0.03 -- 自动连点跳跃的时间间隔(秒),越小连点越快 -- ================================================= local isSliding = false local loopConnection = nil -- 用于控制连点循环的连接 -- 【功能1:无限跳跃基础支持】 UserInputService.JumpRequest:Connect(function() if humanoid then humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end end) -- 核心连点函数:模拟玩家疯狂按空格 local function startAutoJumpLoop() if loopConnection then return end -- 防止重复启动 local lastJumpTime = 0 -- 使用 Heartbeat 帧同步循环,比 task.wait 更精准,能实现极高频率的连点 loopConnection = RunService.Heartbeat:Connect(function() if not isSliding or not featureEnabled then if loopConnection then loopConnection:Disconnect() loopConnection = nil end return end -- 控制连点频率 local currentTime = os.clock() if currentTime - lastJumpTime >= JUMP_INTERVAL then lastJumpTime = currentTime if humanoid and humanoid.Health > 0 then -- 核心:疯狂强制角色进入跳跃状态,从而在滑铲途中不断触发“滑铲跳”的惯性叠加 humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end end end) end -- 【功能2:检测滑铲并开启连点】 UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if gameProcessedEvent then return end if not featureEnabled then return end if input.KeyCode == SLIDE_KEY then isSliding = true -- 玩家一按下滑铲,脚本立刻开始“途中一直点击跳跃键” startAutoJumpLoop() end end) -- 监听按键松开,停止连点 UserInputService.InputEnded:Connect(function(input, gameProcessedEvent) if input.KeyCode == SLIDE_KEY then isSliding = false -- 物理松开时,loopConnection 会在下一帧自动断开 end end) -- 角色重生刷新引用 player.CharacterAdded:Connect(function(newCharacter) character = newCharacter humanoid = newCharacter:WaitForChild("Humanoid") end)
保存修改