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

How to reliably determine when a player jumps?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

UserInputService/JumpRequest

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

0
oh, right, remote events exist. Doh! BrimoireGrimoire 11 — 3y
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. JuuzouBlitz 75 — 3y
0
Yeah, that's what I was realizing shortly after. I may just have to deal with the unreliability of Humanoid.Jump BrimoireGrimoire 11 — 3y
Ad

Answer this question