Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 10 months 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 168 — 10mo
0
I just used events. PoweredBy_Memes 0 — 10mo

2 answers

Log in to vote
2
Answered by
xPolarium 1358 Moderation Voter
10 months ago
Edited 10 months 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 168 — 10mo
Ad
Log in to vote
0
Answered by 10 months ago

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

Answer this question