Getting Tables From A Module Script

Hi, im trying to get a table from a module script, However i keep getting invalid arguements, i have attached images bellow of both scripts. (The names are just for testing purposes hence why they all have similar details)

Module

Server Script

image

Im not very good with module scripts, so if anyone could tell me how to get these tables it would be appreciated!

Thanks.

3 Likes

In the server script the variable func corresponds to what was returned from the ModuleScript you required. In this case, it would point to the table motherTable in the module script. Because this value is not a function, you cannot invoke it like you would a function. However, you can index it like a table because, well, it is a table. Therefore if you wanted to get the table commonItems from the module script, you could have the following code:

func = require(ItemModule) --Keep in mind this is a table value, not a function!

local commonItems = func["commonItems"] --Indexing into a table at the provided key
14 Likes