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

How do you add a value to a module script?

Hello, I would like to know how you can add value (or a player's name) to a module.

I have tried this,

table.insert(module, value)
table.insert(module, #module, value)

I am not the best at modules, as you can tell. Thanks :D

2 comments

1

Are you trying to do this from a server script?

0

Yes

1 answer

FYI, Module requires are synced across the same context level, so if a client requires a module, it will be different from the server version, just in case that's what you're trying to do.

But if your module returns a table it is as simple as just adding an entry to the module.

module[key] = value;

print(module.key)

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