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

Changing Module Scripts from other scripts?

Asked by 6 years ago

Can you change the table in a module script from a different script? Like something like this:

1local table = require(modulescript)
2 
3 
4table = newstuff

Does that change the module's table or the variable?

0
Pretty sure that would change the variable. NotInventedHere 158 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

What you can do is have a variable that changes to newstuff, or whichever module scripts you need. Then use requirement with your variable

1moduleName = MyModule
2 
3table = require(moduleName)
4 
5modulename = SomeOtherModule
6 
7table = require(modulename)
Ad

Answer this question