Can ModuleScripts be used for local scripts?

Basically I want to use some module scripts in local scripts but I have some concerns.

If it’s possible, does it mean players can see EVERY module script in the game? and what’s the best place to store them?

Sorry if this post is too short but I can’t really think of anything else to say.

(post withdrawn by author, will be automatically deleted in 1 hour unless flagged)

If the module scripts are stored in a place like ServerStorage or ServerScriptService, than definitely no. I wouldn’t worry about people stealing your scripts either way.

But what about using them in local scripts?

I’m not really sure what you mean here, since the module script you’re requiring from a local script has to be visible to the client.

yeah, that’s the thing. What’s a good place to store module scripts so they’re visible to the client?

If I understand, you are worried about exploiting, right?
A module script normally is placed in Replicated Storage, so, if you want to use it in a LocalScript it will be replicated locally and will be “visible”.
But it’s not that easy to exploit a game…

Replicated storage or just parenting them to the local script that uses them.

Oh cool! So if I place a module script in replicated storage they’ll be visible to the client?

Yes if you want a module script that can be used in your local scripts, add it in replicated storage. All I’d suggest is to manage/split up your module scripts so that if there are ones that have server side logic only, keep them safely in server storage. Only put the code that you actually need to call from local scripts in modules in replicated storage.

3 Likes