Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Requiring a PrivateModule in a LocalScript?

Hi there!

I'm trying to require a PrivateModule in a LocalScript in which I've realized I cannot, but I was seeing if I could do this:

Just have the event code show in the LocalScript under StarterPlayerScripts and require a script that contains the require(00000) code in it but I'm not sure if that's going to work:

require(game.Workspace["AnnouncementGUI"].eventsLoader)
RemoteEvent1.OnClientEvent:connect(ShowGui1)

1 answer

Your problem may be that you cannot change things in Workspace using a LocalScript. Try moving your Module to ReplicatedStorage instead. ReplicatedStorage is Client and Sever so you can access them from any script. You also want to store the Module in a variable so you don't have to write out that same line every time you're trying to access it.

5 comments

0

Thanks for your help, I am loading in a public module its not in the game but its mine

0

but moving Module script into replicatedstorage mean that exploiters can read it ?

0

you can access workspace from the client

0

Excuse me..? Localscripts cannot access workspace..? But anyway, ReplicatedStorage is always the best place for modules to be in.

0

You can access things in workspace you cannot change things. Since you cannot change things you can't require the Module. Exploiters should not be-able to access the module if you use Filtering Enabled.

This discussion is preserved as it was. New answers, comments, and votes are closed.