Defensive/Anti-Hacker Game Revamp

I am currently working on an overhaul for one of my Roblox games to combat against hacking.

So far, I will be reworking systems that make use of RemoteEvents, and I will be adjusting what is handled in LocalScripts.

If there is anything else that could be vulnerable that I should know of, or if you have any tips/suggestions for the things above, please let me know.

Thanks! :grin:

I’ll speak on this for a hot second; do not trust the client., when you have no option, but to trust the client - then you should limit the amount of control they have.

Let me break down what not trusting the client actually means, though;

  1. everything you get through remote events/functions is equally met with an assert, you should error if something doesn’t add up, or if something doesn’t make sense.
  2. sanitize the strings and numbers that you get, exploiters will embed malicious characters in strings, or send you NaN and that could potentially exploit your code.
  3. min/max test the code you’re working on - see how it handles huge numbers, also see how it handles low numbers.
  4. keep important logic, such as player state (inventory, currenct, progression) on the server - client should be aware of the information, but it should be immutable, you can’t change this on the client.
  5. rate limit the requests you do get, exploiters can sometimes spam your remotes, and if they do something such as query datastores - then they can easily cause your game to hit it’s limits. Add reasonable rate limits with a suitable backoff algorithm.
  6. make sure sound has replication enabled toggled off
  7. RejectCharacterDeletions should be toggled on
  8. I’d suggest even going a step further and demo’ing out the new Roblox server authoritive character replication.

keep any anticheat stuff on the server, focus on hardening your APIs and making your game paranoid on the server, as for the client - only adventure into anticheats if you’re bored or have a cool idea, outside of that it’s a little pointless trying to battle hackers when it’s your code running on their environment.