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 6 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 — 6y
0
I just used events. PoweredBy_Memes 2 — 6y

2 answers

Log in to vote
2
Answered by
xPolarium 1388 Moderation Voter
6 years ago
Edited 6 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 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question