filtergc
Search Luau garbage-collected objects using structured filters.
function filtergc(filterTypefilterType"function" | "table"The type of GC object to search for.: "function" | "table", filterOptionsfilterOptionstableFilter criteria. Fields depend on filterType - see FunctionFilterOptions or TableFilterOptions.: table, returnOnereturnOneboolean?If true, returns the first match directly. If false or omitted, returns a table of all matches.?: boolean): anyanyA table of matches, or a single object if returnOne is true. Returns nil if no match when returnOne=true.Usage
Find a function by its string constant
local target = filtergc("function", {
Constants = { "SuperSecretKey" }
}, true)
if target then
print("Found target function:", target)
endFind all tables with a specific key
local results = filtergc("table", { Keys = { "PlayerData" } })
for _, tbl in ipairs(results) do
print("Found table with PlayerData key:", tbl)
end