Skip to main content

Logger

Scripts can contain special "event" functions that will be automatically called by the program. The functions for global events must be declared in the global scope (i.e. without the local keyword). You can use events to write code that will be run when specific things happen in your world (for example, when an entity is destroyed).

To use an event, you just need to declare a global function matching the name of the event. The following events are available.

print(text)

Writes the specified text string to the log console.

Example

function onStart()
print('Hello world!') -- Writes "Hello world!" to the log console
end