First, you are measuring the delta between positions incorrectly. You should be multiplying both the current speed and magnitude by the frame delta, that way your measurements are correct.
Relying on the client giving truthful information is risky since, for example, a fly cheater can simply let animations play.
The third issue I want to comment on is the structure and readability of the code. Reading it, it’s difficult to tell what is happening until I really piece it together. Try working on your white spacing, collocation, and variable names.
The final issue worth talking about is how you punish by kicking. Strike systems don’t create any room for error on players with extremely unstable internet connections, or users who have a short-term issue. Instead, teleport players back to the last “valid” position so that it still punishes cheaters, without too harshly punishing false-positives.
Thank you for pointing that out, this is my first ever anti-cheat so it may have flaws. About the fly tho many inexperienced exploiters may be experienced as well will not realize the detection instantly.
I will put out a whole revamp of the anti-cheat soon.
I was searching to see if anyone had posted up a server-side anti-cheat system and this was the only match I found. I agree, there needs be some “public” resource for all developers to access the very basics of anti-cheat, which yours addresses but everyone seems to have a lot of complaints about. I thought about posting up my own server-side anti-cheat system in an open-source fashion, but don’t want to interfere with another project already working on this.
Thanks for checking, I do appreciate it and the time you took to create it. Wish more games would at least try to address some server-side anti-cheat as it appears hacking is pretty rampant in all the top games.
There is a bug with the noclip involving the dummy that was in the testing game (also were you using hacks to test in the video cuz there is no fake cheats in the game) robloxapp-20230411-1916345.wmv (2.2 MB)
Before checking the devforum I went on to check the anti cheat and found the same bug 5 minutes before I read this. Well, looks like I won’t have to post about it now! Will try to fix it.