Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Requiring a PrivateModule in a LocalScript?

Asked by 5 years ago

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

Log in to vote
-1
Answered by
zblox164 531 Moderation Voter
5 years ago
Edited 5 years ago

Your problem may be that you cannot change things in Workspaceusing a LocalScript. Try moving your Moduleto ReplicatedStorageinstead. ReplicatedStorageis 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.

0
Thanks for your help, I am loading in a public module its not in the game but its mine MelonRBLX 0 — 5y
0
but moving Module script into replicatedstorage mean that exploiters can read it ? Halogen93 0 — 5y
0
you can access workspace from the client User#23365 30 — 5y
0
Excuse me..? Localscripts cannot access workspace..? But anyway, ReplicatedStorage is always the best place for modules to be in. SCP774 191 — 5y
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. zblox164 531 — 5y
Ad

Answer this question