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

How Do I access a module script from a local script if can't is there any safe alternative way?

Asked by 4 years ago

I have this module in serverstorage and I am trying to make it so that theres an screen where you can choose your magics like fire earth....

but the module is in the server storage and I need the local script to do so I am going to ask you

which way is the safest thing to do it locally or like should I get the module from the serverscript then insert it to like replicatedstorage

This is for a GUI that I am working on

I was going to do a I,v loop from a local script and loop modules but I can't get a module from local script it seems since its in the server storage

2 answers

Log in to vote
0
Answered by 4 years ago

If you want the module script to be used on the Client side, you should keep the module in ReplicatedStorage instead of ServerStorage. Or if you're insistent on keeping the module in ServerStorage, you can create remote functions to fetch the data you want!

Ad
Log in to vote
0
Answered by 4 years ago

that answer is easy.

copy module script to replicated storage, then you can access from local script, as you said in your question. because client side does not see anything in the server, so serverstorage is out of luck

however, however, however,

....

module script is located in caller's universe, so if local script call it, it is located in client side. then there is really no safety.

but if you want to keep the script in the server side, then you don't need multiple copy of it... most likely. you only need one copy of script in the server side to do something on call.

so in order to achieve your primary goal, to run script in server storage for safety access of information, all you need is a remote function to call server script. not module script.

Answer this question