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)
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.