Avorion Script API Documentation

Command Script Predefined Functions

Tip: Scroll down for an example script!

function execute(playerIndex, ...)

Called when the command is being executed. If not exactly 3 values are returned, the command is interpreted as a failed command.

Server Function: This function is only called on the server.

Parameters

playerIndex The index of the player executing the command. nil if the command was issued over RCON interface or console.
... The list of string arguments given

Expected return values

3 values: An int indicating whether or not the command was successfully executed (0: no success, otherwise: success), a response message, an error message

function getDescription()

Gathers the description text of a script command.

Server Function: This function is only called on the server.

Expected return values

A string containing the short description text for the command

function getHelp()

Gathers the help text of a script command.

Server Function: This function is only called on the server.

Expected return values

A string containing the help text for the command


Command Example Script

-- Called when the command is being executed. If not exactly 3 values are returned, the command
-- is interpreted as a failed command.
-- Server Function: This function is only called on the server.
function execute(playerIndex, ...)

end

-- Gathers the description text of a script command.
-- Server Function: This function is only called on the server.
function getDescription()

end

-- Gathers the help text of a script command.
-- Server Function: This function is only called on the server.
function getHelp()

end
Overview
Home Functions Search
Search:

This is the official documentation for the scripting API of Avorion. This documentation is automatically generated and not necessarily complete. Depending on the context in which functions exist, some documentation such as descriptions, return values or variable names or types may be missing.

Work in Progress. Documentation of Avorion Version: 2.5.7 c8e4beec84f7