VERGELua API

Globals

Global functions, constructors, environment, and the globals table.

functions

print(...)

Print values to the Lua console.

printc(...)

Print values with a leading r,g,b,a color prefix.

notify(...)

Show an on-screen toast notification.

LoadScript(name:string):boolean

Load and run a Lua script by name.

UnloadScript(name:string):boolean

Unload a running Lua script by name.

GetScriptName():string

Name of the current script's environment.

constructors

Vector3(x?:number, y?:number, z?:number):Vector3

Create a Vector3; missing args default to 0.

EulerAngles(pitch?:number, yaw?:number, roll?:number):Vector3

Create an angle; returns a Vector3.

BitBuffer():BitBuffer

Create an empty bit buffer.

environment

os.clock():number

CPU time used by the process in seconds.

os.time()

Current time as a Unix timestamp.

os.date(format?:string, time?:number):string

Format a timestamp; defaults to the current time.

string.split(s:string, sep:string):table

Split a string into a table by separator.

package.path:string

Module search path; Verge\lua\?.lua is included.

globals table

globals.realtime():number

Real time since the game started, in seconds.

globals.curtime():number

Server time of the current tick, in seconds.

globals.frametime():number

Time elapsed during the last frame, in seconds.

globals.absoluteframetime():number

Absolute time elapsed during the last frame, in seconds.

globals.framecount():number

Number of frames rendered since the game started.

globals.tickcount():number

Current server tick number.

globals.maxclients():number

Maximum number of clients the server accepts.

globals.interval_per_tick():number

Duration of one tick, in seconds.

globals.interpolation_amount():number

Interpolation amount of the current frame.

globals.RealTime():number

Alias of globals.realtime.

globals.CurTime():number

Alias of globals.curtime.

globals.FrameTime():number

Alias of globals.frametime.

globals.FrameCount():number

Alias of globals.framecount.

globals.TickCount():number

Alias of globals.tickcount.

globals.MaxClients():number

Alias of globals.maxclients.

globals.IntervalPerTick():number

Alias of globals.interval_per_tick.

globals.InterpolationAmount():number

Alias of globals.interpolation_amount.

globals.TickInterval():number

Alias of globals.interval_per_tick.

globals.AbsoluteFrameTime():number

Alias of globals.absoluteframetime.