Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Module script not working?

im testing a modulescript and it won't run, idk why?

I tried printing and it wont work

print("test")

2 answers

✓ Accepted answer

Your module needs to return some data. Otherwise, it won't work.

Module:

print("test")
return nil

Then require it in a server script.

Unlike Scripts or LocalScripts, ModuleScripts have to be called by a command.

For example, If I was doing a ModuleScript with a string, I would do something like this:

---This is the ModuleScript---
local module = {}

module.strings = {

       ["STRING1"] = "Hello! How are you doing?",
}

return module


To call it, I would enter another script and type in something like:

local String = game.Workspace.ModuleScript
local String_Data = String.strings

print(String_Data["STRING1"])

1 comment

0

You need to require() the module first.

This discussion is preserved as it was. New answers, comments, and votes are closed.