Assets With Modules

I apologize for asking this question as I faintly remember the answer. It’s been a while since I’ve developed on ROBLOX.

If I were to create a Model with a ModuleScript named “MainModule”. Is it possible to load the model into the game without exposing the module script? (I remember reading something along those lines a while back.)

Also, can any exploiter load an asset from an in-game server and have access to the contents? Or is it just server sided.

I remember knowing the answers to most of these questions, it’s been about a year. Thank for your time.

1 Like

Yes, you can require it by ID. Keep in mind you have to be the creator of the private module to use it.

It should be server-only—there’s no reason to send it to the client—but I’m not entirely confident in Roblox’s security capabilities given how much can be spoofed.

3 Likes

I believe so. If you publish the model, you can require it using the AssetID (not as a string) just make sure the module is not allowed to be copied.

Edit: If the module is Server-Side you have nothing to worry about.

1 Like

There shouldn’t be any problem when using a ModuleScript, technically the exploiters can’t acces it, or do they can?

Sounds good, and one final question. If I do load an asset with a module (server side), could the result be transferred to the client? As in the table contents returned by require(module)?

I’m basically trying to figure out a way not to expose module scripts on client machines.

1 Like

You can fire a table to the client, but functions wouldn’t replicate across the client-server boundary. You’d have to at least store that much on the client.

3 Likes

I see, so variables would transfer but not the methods. Ok, thanks a bundle for the helpful information. I guess some things just need to be on the client :slight_smile:

1 Like