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

How Module script local value?

Asked by
LostPast 253 Moderation Voter
6 years ago

If I require this module script can I access tableA or do I have to access it through the functions? If it is a local value can I get the table value in the module from the script?

Module script;

1tableA = {}
2local CM  = {}
3 
4function CM.GetTA()
5    return tableA
6end
7 
8return CM

Script;

1local CM = require(Module)
2 
3local tableA = CM.GetTA() --this or
4CM.tableA --this

1 answer

Log in to vote
2
Answered by 6 years ago

I believe you can have a variable that looks like this,

1CM.Variable = "Whatever"

Then you can access it like,

1local CM = require(Module)
2local newVariable = CM.Variable
Ad

Answer this question