I have been trying to make a script that searches if there is a global table (Network for example), and if there isn’t one, the script will create one and add itself to it, but if there is one, the script will just add its parent to it. I could not make this because of limited reference of _G on the developer hub.
Any help or better suggestions to make this work would be very appreciated!
You really shouldn’t be using _G if you can help it. If you need a table to be used across scripts, use a ModuleScript. It’s generally seen as a bad practice to use the _G table at all, since it might be unintentionally affected by other scripts and it’s hard to debug where its changes are coming from.
About the same way you’d use _G but requiring a module from a mutually accessible location (e.g. ServerScriptService). Gets rid of the global bit, retains functionality, accessible by all except the client.