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

Is there any type of variable that could be accessed by multiple scripts?

Asked by 3 years ago

For example 2 scripts could both use 1 variable.

0
_G, values as the guys mentioned in the answers. I would rather use attributes or use remote events to connect variables to other scripts. greatneil80 2647 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

You can use a IntValue that is parented in 'Replicated Storage'(If you want a client & server script to acces to that value). You can also use a attributes that can be inside of a script or any instance you want. (If you change a value in a local script, the server will not detect that the variable changed.)

Ad
Log in to vote
0
Answered by 3 years ago

you can use _G to store variables between multiple normal scripts

example:

_G.variable = 10


another normal script will be able to access it

Answer this question