How do I get the current environment’s globals?

Is it possible to grab all the Roblox and Lua globals in the current environment as a table? Like math, os, game, require, etc.

My first thought was to use getfenv to do this, but:


Just prints a table with only a “script” key.

Any help would be appreciated.

1 Like