Skip to content

Global functions

print

print(...)

Prints text to console.

Parameters

Name Type Description
... any... Any variable that can be converted to string

Usage

print(1, 2, 'Hello!');

error

error(msg: string)

Prints an error and stops the script.

Parameters

Name Type Description
msg string Error message

Usage

error('Something does not work here!');

require

require(path: string) -> any

Loads a library.

Info

Libraries are located in ev0lve/scripts/lib

Parameters

Name Type Description
path string Path to library

Usage

local my_lib = require('my_lib'); -- will be loaded from ev0lve/scripts/lib/my_lib.lua

loadfile

loadfile(path: string) -> any

Loads a file as a function. Can be executed with pcall().

Parameters

Name Type Description
path string Path to the Lua file

Usage

local fn = loadfile('other_script.lua');
pcall(fn);