What are the limitations for _G, if there are any?
None. It's a table. The only limit you have is a memory limit, Lua will throw a out of memory error (and roblox will crash) if you fill it up with too much. How much? We don't know - I don't know how much memory the servers have, and every client has another amount of RAM available.
If you never got an out of memory error before then you don't have to worry about this. Memory gets usually filled with huge constant data. Lua should be able to handle a lot of functions.
_G
is an ordinary Lua table, which essentially means it has no limitations in terms of its storage capacity.
However, in the context of sharing between different scripts/threads, it is notable that LocalScript's for any particular client have their own_G
which is separate from the server's (normal Script objects') _G
; so _G
cannot be used to communicate between LocalScripts and server Scripts.