So, i’m now focusing on scripting since thats the most important role, and i am learning module loaders:
I saw many possible erros on his script and i am trying to fix it, one of the changes i made was creating another folder for Services that are on the server, since if i put the serverside on the replicatedStorage, exploiters will see the code
My question is, this way, with the module on the server side, can it still be leaked because the loader is located on ReplicatedStorage and requiring the modulescript that is on the server?
“MyServices” is the loader btw
Another question is:
Is there a better way of organizing scripts? I’m still learning it.
Anything you put on the client side, eg if it’s replicated will be visible to the client.
You should store all your server related code on the server side.
But if your modulescript loader is a module stored in a replicated service, and gets required on the server it will be able to access it since it’s running from the server.
My code is loading every module that is inside Services, i can also get the module and use them, what i want to know is, if i put a module on the serverscriptservice, and call it on the loader module on the replicatedstorage, will exploiters see the server side?
No, you can search needed module using :FindFirstChild(ChildName, true) on client-side’s folder (in your case its ReplicatedStorage.MyServices), and if its doesn’t exist, just search on server-side’s folder (ServerScriptService.MyServices) using the same method if you have access (RunService:IsServer)
Client-side can only access every ModuleScript and LocalScript that located on client-side. For example: GameService module that is located in ServerScriptService/ServerStorage can be accessed only for server-side module loader, for client-side it would be nil.
Thank you, thats what i was asking for, but while searching i ended up not using it, just saw people saying that u lose many things such as type checking
If u make a change to the server in ur module, the client will be changed because it is replicated. However, changes on the client cannot interfere with the server side, and u cannot access the Script.Source from the Roblox Game Client. And if u try to access a Script.Source, its output will print: The current thread cannot read ‘Source’ (lacking capability PluginOrOpenCloud). But if u prefer to separate the client from the server thats fine too. (An example is when u making ur communicator, u search for a event and if u cant find, u create an remote event instance, because the server loads before the client)