Documentation

func

func

Syntax: zs.func.funcname(arguments)

'func' is a virtual Lua table that points to all of the zScript functions. It will execute a specific zScript function with the given arguments and return it's value. Even if you do not want to send any arguments to the function, you must still always use the parenthesis, just like with any other Lua function.

For example, to call the %additem function you could do this:

print(zs.func.additem("item3","item1|item2"))

Adds "item3" to the string list and returns the resulting list. Notice that Lua treats the string list as a Lua table and prints it as expected.

Add comment

Login or register to post comments