vm
Raw Luau GC access for scanning, reading, and writing game-VM GC objects by key.
vm.GetGc(name: string | {string}?) -> {table}
With a key name or array of key names, does a by-key lookup and returns an array of entries with key, value, type, and addr fields. With no arguments, walks the whole GC heap and returns an array of entries with address, type, and typename fields for real GC-page objects.
local entries = vm.GetGc("Health")for _, e in entries do print(e.key, e.value, e.type, e.addr) endvm.SetGc(targets: table) -> number
Rescans the GC for entries matching the given key/value targets and writes each matching scalar in place, returning the count of successful writes.
local written = vm.SetGc({ Health = 100 })print(written)ApplyGc
Section titled “ApplyGc”vm.ApplyGc(cache: {table}, targets: table) -> number
Writes the given key/value targets into the addresses already present in a table previously returned by vm.GetGc, without rescanning the GC heap.
local cache = vm.GetGc("Health")local written = vm.ApplyGc(cache, { Health = 100 })print(written)