Volt

LuaStateProxy.new

Constructs a new LuaStateProxy based on the current Lua state.

Syntax

LuaStateProxy.new() -> LuaStateProxy

Parameters

This function takes no parameters.

Returns

TypeDescription
LuaStateProxyA 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!")
]])

On this page