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

2 answers

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

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

Answer this question