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

Is there any way to have one variable that can be used by multiple scripts?

Asked by 5 years ago

Thanks for your knowlege.

0
You have multiple options, but the two I would use are, _G (try to avoid these) or module scripts (Highly recommended) turtle2004 167 — 5y
0
I just used events. PoweredBy_Memes 2 — 5y

2 answers

Log in to vote
2
Answered by
xPolarium 1388 Moderation Voter
5 years ago
Edited 5 years ago

Module Scripts can store things like tables, functions or variables.

Other scripts access the module script using the require() function.

0
Bonus tip: Always put your require() functions at the beginning of your scripts, it improves readability, and makes your scripts look much nicer. turtle2004 167 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

You could just use values... Like an IntValue, StringValue, BoolValue, ect.

Answer this question