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

What are the limitations for....?

Asked by 10 years ago

What are the limitations for _G, if there are any?

2 answers

Log in to vote
3
Answered by
jobro13 980 Moderation Voter
10 years ago

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.

Ad
Log in to vote
2
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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

Answer this question