Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you add a value to a module script?

Asked by 4 years ago

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

1
Are you trying to do this from a server script? AlexTheCreator 461 — 4y
0
Yes UraniumBanana5 33 — 4y

1 answer

Log in to vote
0
Answered by
Gojinhan 353 Moderation Voter
4 years ago

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)
Ad

Answer this question