LuaStateProxy.new
Constructs a new LuaStateProxy based on the current Lua state.
Syntax
LuaStateProxy.new() -> LuaStateProxyParameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
LuaStateProxy | A new LuaStateProxy for the current state |
Description
LuaStateProxy.new creates a new LuaStateProxy instance representing the current Lua execution state. This allows you to access state properties and execute code on the current state.
Example
-- Create a proxy for the current state
local state = LuaStateProxy.new()
print("State ID:", state.Id)
print("Is Actor State:", state.IsActorState)Get Current State
local state = LuaStateProxy.new()
-- Access state properties
print("State ID:", state.Id)
-- Execute code on this state
state:Execute([[
print("Executed on current state!")
]])Related Functions
getluastate- Get LuaStateProxy for an actor or scriptgetgamestate- Get the default game Lua stateLuaStateProxy:Execute- Execute code on the state