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

2 answers

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

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

Answer this question