Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Humanoid Jumping Event Not Always Detected?

Asked by 5 years ago
Edited 5 years ago

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)
0
Can you try relinking, you did something wrong. Thundermaker300 554 — 5y
0
I fixed the link, thanks for pointing that out. GrandpaScriptin 148 — 5y
0
thumbs_up Thundermaker300 554 — 5y
0
why did you use "connect" danglt 185 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.

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. GrandpaScriptin 148 — 5y
0
Did it error? Thundermaker300 554 — 5y
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. GrandpaScriptin 148 — 5y
0
Read my edited message. Thundermaker300 554 — 5y
View all comments (2 more)
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 GrandpaScriptin 148 — 5y
0
why did you use "connect" danglt 185 — 5y
Ad

Answer this question