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;

tableA = {}
local CM  = {}

function CM.GetTA()
    return tableA
end

return CM

Script;

local CM = require(Module)

local tableA = CM.GetTA() --this or
CM.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,

CM.Variable = "Whatever"

Then you can access it like,

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

Answer this question