I wanted to create a solo, lag free game, even if it meant exploiters could cheat to win on it by changing variables on the game. The only problem that I think of is that localscripts code can be read by exploiters, while serverscripts on serverscriptservice cant. Is there a way to protect the source of localscripts so people cant clone my game?
Is there anyway to protect localscript codes?
2 answers
I suggest reading all of this.
Unfortunately, exploiters have programs available that can capture the local code even if you require them from outside of the game. The programs run at a higher level than you as a developer even have access to. Think of it like this: You are literally giving clients the code. No matter what you do, the client can access the code.
Hiding your local code should only ever be thought of as a deterrent since exploiters will always be able to access them. This is why you must use sanity checks on the server to make sure the information sent from the client is correct.
So in short, keep important data in your server scripts and only send information to the client. Remember that the main source and true engine of the game stems from the server scripts. Without the server scripts your game is basically a frame of a car, so it will not help an exploiter much.
A hacker/exploiter can read all localscripts.
2 comments
What about the outside modules i mentioned on the comment?
He knows that. He said "localscripts code can be read by exploiters" He is asking how to protect his scripts from exploiters.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
I saw somewhere that i can require modules i made from outside of the game. I would also like to know if the code becomes readable in the game after i require one with my local script.
The client can do anything they could normally do in a localscript - fire events, move their character, delete stuff in their character, delete their local scripts, etc. They can write their own code and run it in your game. Good rule of thumb is never trust the client with anything and assume they can change anything locally.
and yeah you can require your modules from outside the game, but i think only on server. You could have a remote event for it, but then you would want to make sure hackers can't get that code.
That part of players deleting and building what they want with exploit isnt what concerns me, as i mentioned. What i fear would be the cloning of source, directly from the localscript or a require function it made from a module.