Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Humanoid Jumping Event Not Always Detected?

I am having trouble with the Jumping event of the humanoid in my game. The event seems to have a mind of its own in that it will sometimes fire on time, be delayed in firing, or never fire at all. It works as intended in play solo mode, but in online or local test server mode the problem occurs. Here is a link to a demo (https://www.roblox.com/games/2018837374/Jump-Problem) which is copy enabled, where you can replicate the problem by making a local test server with 1 person. "Jumped" is printed to the console when the event actually fires. Another strange occurrence is that when the jumped event fires it fires 2 times. I'm not sure if that is intended or not I just thought I would add it.

Here is the jump detection script.

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		char.Humanoid.Jumping:connect(function()
			print("jumped");
		end)
	end)
end)

4 comments

0

Can you try relinking, you did something wrong.

0

I fixed the link, thanks for pointing that out.

0

thumbs_up

0

why did you use "connect"

1 answer

✓ Accepted answer

Can reproduce your issue. It must be a Roblox glitch. I'll forward it to a friend of mine on the devforum and see if it can make it on. For now, using GetPropertyChangedSignal("Jump") should work.

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        char.Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
            print("jumped");
        end)
    end)
end)

EDIT: My friend said that it fires twice because there's an argument which determines whether they just jumped or are falling down. Additionally, he said you should be using it on the client side, since the server has latency.

6 comments

0

Thank you for your answer and passing this along to the roblox devs. I tried your code and it did not work at all server-side. I think it is because the Jump property isn't replicated to other clients (http://robloxdev.com/api-reference/property/Humanoid/Jump). Maybe I am doing something wrong.

0

Did it error?

0

No it just did not print "jumped". I tried putting it in a local script and it worked which is what lead me to my suspicions.

0

Read my edited message.

0

So if I should be using the event client side, should I use a remote event to communicate the jump to the server? How would I prevent exploiting to the remote event if so? Again thanks for all your help

0

why did you use "connect"

This discussion is preserved as it was. New answers, comments, and votes are closed.