What is a more reliable way to detect when a player jumps?

I am currently using StateChanged to detect if a player is jumping, but it is extremely unreliable, as it only detects every 3 (or so) jumps.

My question is, is there a better way to detect player jumps (on the server)? If there is, what is this method?

Current Code:

	local jumpPower
	local isJumping = false
	p.CharacterAdded:Connect(function(c)
		jumpPower = c.Humanoid.JumpPower
		local jumps = jumpAmount.Value / 10
        jumps = jumps + 50
		c.Humanoid.JumpPower = jumps
		c.Humanoid.StateChanged:Connect(function(oldState, newState)
			if newState == Enum.HumanoidStateType.Jumping then
				if not isJumping then
					isJumping = true
					jumpAmount.Value = jumpAmount.Value + 1
				end
			elseif newState == Enum.HumanoidStateType.Landed then
				if isJumping then
					isJumping = false
				end
			end		
		end)
	end)

Thanks!

Use Humanoid.Jump, instead of using StateChanged.

Not necessarily more reliable, but it’s a different method.

@Trizxistan beat me to the reference but Humanoid.Jump will suffice.

It’s a simple event that is called each time the user jumps.

-- Taken off the wiki
humanoid.Jumping:Connect(function(isActive)
	print("Jumping: ", isActive)
end)

However I don’t really think that you will receive any less “bugs” or it’ll be any more reliable. I’m wondering if your setup is wrong?