Skip to main content
Returns every object (as a table) Roblox is currently holding alive - functions and userdata by default, plus one extra type if you provide the filter argument.
Pass true to also include tables, or pass a type name ("thread", "string", "buffer", or "table") to also include values of that type. With no argument, the list only contains functions and userdata. Most commonly used to find functions you cant find via any other method.

Parameters

The function takes a single optional argument that can be either form below. Pass one or the other - same arg slot, mutually exclusive. Any other string, and any other arg type, will raise an error.

Returns

{function | userdata | thread | table | string | buffer} - Returns a table containing every live GC object that matches the requested set. The default set is functions and userdata; the filter argument adds to that set (does not replace it).

Example

In a Roblox game, find the central game-data table by a couple of known keys - useful when no script ever hands you a direct reference to it.
Anticheats often set up an __index honeypot: a table that hands back a value for any key you check, even ones it doesn’t really have. Read keys with rawget so it can’t trick you.That vector is most commonly aimed at Dark Dex (and its forks) - the moment Dex references any Instance, the honeypot fires and you get kicked.They also may use a weak-table trap: a honeypot object is the only value in a __mode = "v" table, with nothing else referencing it. Garbage collection normally removes it from the table. If your getgc scan still references that object, it will stay => anticheat sees the object having a reference => anticheat kicks you. The check looks something like this:
The entries inside the tracked table don’t have to be real game objects - a newproxy() or {} work too. So don’t keep references to objects from getgc - read what you need and don’t store them.