Private Modules Question

Hello, hope you are feeling well! I know I talk a lot about Private Modules even they were removed for Third Party Use (they can still be used by the owner). Well lets get to the question:

When Private Modules gets required from a Server Script, where does this Module goes to? In game, does this one replicates to the Client? (The module doesn’t have any backdoor to parent itself somewhere else).

require(123456789)

Sorry for repeating, will it get replicated or it will only be seen by the server?

1 Like

It shouldn’t get replicated to the client, as far as I’m aware. It’s getting fetched on the server and being used by the server; I don’t see any reason why they’d replicate it to the client, but Roblox is Roblox so they might.

3 Likes

Not sure what to believe lol, “Roblox is Roblox so they might .” Is already scaring me.

You can find out yourself by putting this into a ModuleScript:

local module = {}
module.FindParent = function()
    print(getfenv(2).script.Parent)
end
return module

and in your ServerScript:

local module = require(id)
module.FindParent()

If the Parent property is a client accessible area then it is indeed replicated, otherwise it’s not

Credit: Module script required from local script - #15 by JarodOfOrbiter

3 Likes

Which are the clients accessible areas? Does nil count as an accessible area?

I’m not too sure about nil, the only ones I know of are Workspace, ReplicatedFirst, ReplicatedStorage, StarterGui, StarterPlayer, and descendants of their own Player object

1 Like

Does the Server and Client has same nil table? I HOPE NOT cuz they can be access by exploiters…

1 Like

Client accessible game locations (Workspace, PlayerGui, ReplicatedStorage) are different from the object existing in memory. It can exist in memory even if the script can’t be accessed in the game. Unfortunately, I don’t have a better answer. You would need to use a memory viewer to find your code, but I couldn’t tell you what it looks like as bytecode.

1 Like

nil isn’t a table, but I know what you mean. nil is just saying ‘don’t store this anywhere’.
Two objects parented to nil aren’t parented to the same spot. It’s like how you can’t double infinity and get double infinity, infinity is a concept not a number.
No, the issue is understanding whether when the code is loaded onto the server, it also loads onto the client for no reason. That shouldn’t happen, it should be safe. But as Rogchamp said, Roblox is Roblox. We can’t be 100% certain without confirmation. But by all rational logic there is no reason for it to load onto the client.

2 Likes

It printed: ServerScriptService now the thing is, I heard roblox doesn’t replicate Server Side Code to the client. I also use this module across scripts which just like 2 are in the Workspace.

How would I check if they replicate does using Dex Explorer will help?

EDIT: I am talking about the one made on Roblox not the exploit itself…

Yes you could require the module through a server-script (within game.ServerScriptService, though even if used within a container shared between the client and server the source isn’t compiled on the client) and no client would even know you’re requiring something anywhere.

I don’t think you can even require by id on the client anyway.

2 Likes

Because I was scared of something like it, I kept my module in use between ServerStorage and ServerScriptService. Now I just don’t know if the module replicates to the client lol. I am supper lost in that.

If the ModuleScript really is parenting itself to Workspace each time you require it from there, then that would be an issue because a ModuleScripts’s source is replicated to the client (as long as it’s in a client-readable area).

1 Like

The module is never parented somewhere, actually if you print the parent of the Module it says is nil

print(script.Parent.Parent)

script.Parent: Model
script.Parent.Parent: Nil
Prints nil.

Exploiters are able to view Nil instances (whether this is shared between the client and server I have no clue), but as Rogchamp and JarodOfOrbiter said this shouldn’t be a problem unless Roblox decides to replicate the source to the client for whatever reason

1 Like

Idk if this is consider as Spam or Not: But thank you everybody! For taking the time to help me! :slight_smile:

1 Like