How do I make this jump detector work?

Hi! This jump detector I made on the server does not work. There are no errors in the output. I believe it’s because I fired this on the server instead of on the client.

How do I fix it so it fires on the server only (and works)?

		local debounce = true
		game:GetService("UserInputService").JumpRequest:Connect(function()
			if debounce == true then
				debounce = false
				jumpAmount.Value = jumpAmount.Value + 1
				wait(.5)
				debounce = true
			end
		end)

Try using Humanoid:GetPropertyChangedSignal("Jump") or Humanoid.Jumping as an event. Make sure you don’t count the jump if it was changed to true.

2 Likes

Keep in mind that the property is named “Jump”. Also yes, it does change to true when you first jump until you get to the apex of your jump and start falling, then it will change to false.

Humanoid.Jumping is an event, Humanoid.Jump is the property.

Humanoid.Jumping:Connect(function(isActive)
    if isActive then 
        print("Jumped")
    else
        print("Jump ended") -- this doesn't mean they landed by the way
end)

I’m pretty sure this works the same as GPCS on the Jump property.

Humanoid.Jumping docs (@ChasingNachos)

1 Like

You can’t fire anything meant to be client sided like UserInputService functions and events on the server, only on the client.

I believe JumpRequest may be fired multiple times so you may have to use the Humanoid to get its state for more.

The above replies can work as a solution to doing it on the server.