I'm new on Roblox developping and Lua and I'm stuck on a very basic issue, I've created a module script that returns a dictionary with some values... I need that dictionary on another script... but how?

Here's my code (script is in ReplicatedStorage) :

local ConfigLevelsModule = {{key = "book",preu = "3"},{key = "video",preu = "2"}}return ConfigLevelsModule

then on another script (is on Workspace) I do:

local ConfigLevelsModule = require(game.ReplicatedStorage.ConfigLevelsModule)

but give me this error

 19:30:54.940 Attempted to call require with invalid argument(s). - Servidor - Script:2

How to do it?

Thanks

1

Best Answer


This error shows up when you call require with something that isn't a ModuleScript.

Double check that game.ReplicatedStorage.ConfigLevelsModule is actually a ModuleScript and not a regular Script or LocalScript.