Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

For example 2 scripts could both use 1 variable.

1 comment

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.

2 answers

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.)

you can use _G to store variables between multiple normal scripts

example:

_G.variable = 10


another normal script will be able to access it

This discussion is preserved as it was. New answers, comments, and votes are closed.