Difference between revisions of "Lua:resetLuaState"

From Cheat Engine
Jump to navigation Jump to search
(Created page with ''''function''' resetLuaState() Creates a new lua state object. This means that all previously declared functions, variables and other objects will become inaccessible. ===Fun…')
 
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
'''function''' resetLuaState()
+
[[Category:Lua]]
 +
{{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}}
  
===Function Parameters===
+
===Returns===
<none>
+
This function does not return a value.
  
== See also ==
+
===Examples===
* [[Lua]]
+
<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}}

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