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

How to reliably determine when a player jumps?

I've been trying to develop exploit protection that protects against JumpPower exploits which uses this equation as a threshold: rootPart.Position.Y > lastPos.Y + (humanoid.JumpPower^2 / (2 * workspace.Gravity)) where lastPos is the players position before jumping and rootPart is the player's HumanoidRootPart. But I've found that reliably determining when a player has jumped is extremely unreliable.

I've tried all of the solutions in these posts: https://devforum.roblox.com/t/does-any-of-you-guys-know-of-a-reliable-way-to-detect-when-a-player-jumps/282638 https://devforum.roblox.com/t/how-to-detect-when-the-player-jumps/405774

I originally was doing GetPropertyChangedSignal("Jump") to determine when a player jumped, but this proved unreliable as in about every ~11 or so jumps Humanoid.Jump didn't seem to want to change from false to true.

Humanoid.Jumping and Humanoid.StateChanged proved even worse, the change is only detected once every 6 or so jumps.

I could listen for changes in Humanoid.FloorMaterial, but due to the nature of the game this is being implemented in (one where random events occur periodically as the core gameplay) there could be a situation where say, a large brick spawns and gets flung around and ends up hitting a player, which may fling the player into the sky. Due to how my threshold works currently as I described above, the player could get punished for being a victim of roblox physics if I rely solely on FloorMaterial being Air or not.

And I don't want to do any input detection client-side, as this is part of an anti-exploit.

Does anyone know of a reliable method to determine when a player jumps, or a better detection threshold so that I could utilize FloorMaterial? Or do I just have to deal with some unreliability?

1 answer

UserInputService/JumpRequest

You can fire a remote event when a jump request is detected.

3 comments

0

oh, right, remote events exist. Doh!

0

But cant exploiters just delete the script on the client that fires that remote? Never trust the client with sending information like this. Its better to find a way to check on the server, without asking the client if it jumped.

0

Yeah, that's what I was realizing shortly after. I may just have to deal with the unreliability of Humanoid.Jump

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