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

Does '_G' work between two local scripts?

I have two local scripts and I want them to share a variable, and the first way that I tried crashes studio so this may be my only other option. Is it possible?

1 answer

✓ Accepted answer

Yes, but you cannot use anything added to the global table in a LocalScript from a Script.

Items added from a Script can be accessed in a LocalScript, but not vice versa.

2 comments

0

Also, if you add something in a local script, it's only in the _G table for that client. So, _G.number could have different values for different players, or not exist at all for one player

0

Yes, I should've added that.

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