Difference between revisions of "Lua:resetLuaState"

From Cheat Engine
Jump to navigation Jump to search
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' resetLuaState()
+
{{CodeBox|'''function''' resetLuaState() ''':''' void}}
  
Creates a new lua state object. This means that all previously declared functions, variables and other objects will become inaccessible.
+
Creates a new Lua state that will be used by Cheat Engine.
  
 +
The old Lua state is not destroyed. This means that calling this function can leak memory.
  
 
{{LuaFunctionParametersNone}}
 
{{LuaFunctionParametersNone}}
 +
 +
===Returns===
 +
This function does not return a value.
 +
 +
===Examples===
 +
<pre>
 +
resetLuaState()
 +
</pre>
 +
 +
<pre>
 +
-- Use with care. The old Lua state is not destroyed.
 +
resetLuaState()
 +
 +
print("A new Lua state has been created")
 +
</pre>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Latest revision as of 00:51, 25 June 2026

<> Lua API Reference

function resetLuaState() : void

Creates a new Lua state that will be used by Cheat Engine.

The old Lua state is not destroyed. This means that calling this function can leak memory.

Function Parameters[edit]

<none>

Returns[edit]

This function does not return a value.

Examples[edit]

resetLuaState()
-- Use with care. The old Lua state is not destroyed.
resetLuaState()

print("A new Lua state has been created")

Main Pages

Core Lua documentation entry points

Lua
Script Engine