Module Loaders can be leaked?

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.

2 Likes

if it’s not an assetid no the source code of the module can’t be stolen

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.

So i should have a module loader for client and server? 2 module loaders?

Yes, your client side loader cannot access anything stored on the server since it’s not replicated.

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.

this way?

Without understanding what your code is doing I can’t tell.
Your structure doesn’t provide enough information.

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?

Myservices:

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)

little suggestion, you’re nesting your code rn

function example(isAuthenticated, isAdmin)
    if isAuthenticated then
        if isAdmin then
           return true
        end
    end

    return false
end

could be written as

function example(isAuthenticated, isAdmin)
    if not isAuthenticated then
        return false
    end

    if not isAdmin then
       return false
    end

    return true
end

making it look cleaner

3 Likes

also which of the scripts is this in the screenshot?

MyServices from replicatedStorage

teached this

Ok so what is the current issue you are having? any errors?

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.

5 Likes

Don’t use module loaders, its just worse scripts

3 Likes

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

1 Like

This is not a discussion post rather a scripting support post, if you’re gonna go off-topic make a post on it in the discusion area not here.

1 Like

What would be a good soluction then for organizing?

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)