GG help
Lua in GameGuardian

The language version is Lua 5.3.

The binary chunks version is Lua 5.2.

The coroutine library is missing. Some functions are blocked for security reasons (os.execute, io.popen), some are changed (os.exit).

The bit32 library and Lua 5.2 functions that were removed in Lua 5.3 (e.g. math.pow) are present.

Math is different from regular Lua. For binary operations, the first operand determines the type of result. For example,
3 / 2.0 will be 1, but 3.0 / 2.0 will be 1.5;
3 + 2.5 will be 5, but 2.5 + 3 will be 5.5.

Garbage collection is different from classic Lua:

  1. __gc metamethods do not work.
  2. Data in local variables may not be collected by garbage collection, even if the variables are out of scope. Use the assignment to nil to allow garbage collection to remove the object.
  3. Deletion of dependent objects does not occur in one garbage collection, as in the original Lua. For a dependency of depth N, N steps of garbage collection are required.
  4. collectgarbage is not a direct order to collect garbage. This is just a hint for the garbage collector. Garbage collection may not be completed.