Answered by
6 years ago Edited 6 years ago
If you meant returning a table, yes, you can simply return a table from your ModuleScript
. Since table values are of reference type, and module return values are cached, every time you require the module, a reference to the same table will be returned.
If you want to send a table to a ModuleScript
via a function it returns, I recommend returning a function that takes a table as an argument, and operates on that, but that's not particularly useful, and limits how other scripts and modules can interact with your module. Instead, I recommend passing data the module needs as arguments to functions, and returning a dictionary of functions from your module.
In your case, you are attempting to call a function that the module returns, but it returns a number, and this isn't what you want. Additionally, I recommend against requiring modules by ID, it's much better to insert them into Studio and require them by their instance.