local Input = game:GetService("UserInputService") local player = game:GetService("Players").LocalPlayer local humanoid, stateConnection local firstJump, spent = 0, false local function bind(character) if stateConnection then stateConnection:Disconnect() end humanoid = character:WaitForChild("Humanoid") firstJump, spent = 0, false stateConnection = humanoid.StateChanged:Connect(function(_, state) if state == Enum.HumanoidStateType.Jumping and not spent then firstJump = os.clock() elseif state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Running then firstJump, spent = 0, false end end) end player.CharacterAdded:Connect(bind) if player.Character then bind(player.Character) end Input.JumpRequest:Connect(function() if not humanoid or humanoid.Health <= 0 or spent or firstJump == 0 then return end if humanoid:GetState() == Enum.HumanoidStateType.Freefall and os.clock() - firstJump > 0.16 then spent = true humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end end)