How can I make a script security system?

  1. What do you want to achieve? Keep it simple and clear!

    I am currently making a game in which you collect objects on the local side of things, which then fires a remote event to a server script to handle the rest of it. However, I see videos where exploiters can use command prompts to fire remote events to the server themselves, making it so they can basically collect any object in the game easily if they know the name. So, I want to build some kind of security system I can use to make it so exploiters can’t access or manipulate the remote event without getting kicked, with almost 100% certainty if possible. (Even that 1% chance could be horrible, especially considering that the game will have some kind of economy later on)

  2. What is the issue? Include screenshots / videos if possible!

    I’ve thought about how to make some kind of security system a while now, but I seem a little lost. I’ve tried other options, but I have no idea where to start, and all my attempts just wouldn’t work.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

    I looked around for a bit on the developer hub, but couldn’t find anything relating to my problem (I’m not the best with research so I could’ve used the wrong keywords or something. If you know someone else who had the same question and got it answered, please comment a link to it down below). I thought I could use some sort of password system that updates every second using an algorithm, and although that could work, I heard that experienced exploiters could read local scripts, meaning that they could technically get in if they get the right timing and know the algorithm. So, I was going to ask if anyone had had a similar problem to mine and how they solved it, or if anyone else has an idea on how to solve it.

If you have any questions, ask below! Thanks!

If an exploiter could read a local script, couldn’t they get the code? Though, I do have a question, how would you do it without remote events? Get a similar result, I mean, while also being able to keep it secure?

Yes, you can use Remote Events, what you shouldn’t do is trust that it was an honest call. Even if the game works the way you did, you need to imagine what the exploiter might do “What if he changes this value? Hmm… I need to do that check first”. You should do this for many scripts that interact with the client, not just Remote Events.

The quest for perfect code drastically harms the security of games. Unfortunately, you need to do a lot of “If” checks if you want to have a secure game. Optimize other parts of your code, but keep security as a top priority.

Spawn the objects on the server and on the client make the objects not meant for this client invisible. On the server side connect a .Touched on all the objects and check if the hit character is really close to the object (to prevent fake firing of the event by the client).
Also add an anti-tp script (there are a lot) and a cooldown on collecting the objects.

Sorry for the necro bump, I happened to come across this thread :slight_smile: