Making an anti-cheat system, but want to know how to detect changes on the client

For anyone reading this topic and for any lurkers in the future, here are a handful of most clientside physic exploits and a solution on how to stop them from doing it.

Physic exploit 1: Changing their walkspeed.
Solution: Every heartbeat frame, check their magnitude of their current and previous position. If it’s higher than their walkspeed (you’ll need to create a mathmatical formula to get these numbers) then send them back to their original position.

As a bonus, this also stops exploiters from teleporting.

Physic exploit 2: Noclipping
Solution: Every heartbeat frame, send a raycast starting at their previous position and their current position. If they go through an object, send them back. For performance beneficial reasons, you can get objects in a 10 stud radius using OverlapParams and only check if they go through nearby parts instead of the whole game.

Physic exploit 3: Flying/Jump exploits
Solution: Be warned, this is definitely the hardest physic exploit to prevent. In short, you have to constantly check what the player is standing on every heartbeat. If they aren’t standing on an object for an x amount of time (you’ll have to factor in jump power and gravity) then reset them to their previous position.

Also, when you send a player back to their position, I suggest also taking away NetworkOwnership of their HumanoidRootPart. This means the player can’t teleport back, walk through clientside objects, etc, for a short amount of time (Until you give it back).

4 Likes