MoonVeil-Docs/content/docs/macros/MV_INDEX_TO_NUM.md
2025-08-19 13:43:31 -05:00

538 B

weight title description icon date lastmod
100 MV_INDEX_TO_NUM Obfuscates named indexes code_blocks 2025-05-01T18:47:58-05:00 2025-05-01T18:47:58-05:00

declare function MV_INDEX_TO_NUM(tbl: {}): {}

will replace all instances of named indexes with a unique number constant.

Valid Usage

local foo = MV_INDEX_TO_NUM({total = 0})
for i = 1, 10 do
  foo.total = foo.total + i
end
return foo.total

turns into:

local a={[19314]=0}
for b=1,10 do
    a[19314]=a[19314]+b
end
return a[19314]