Registers a function as a global Lua function in the main script environment. This function becomes a first-class Lua function callable by any Lua code in events or other plugins.
- Parameters
funcName | The name of the function as it should appear in the Lua state |
func | The function to call when invoked from the Lua state |
minArgc | minimuim number of arguments expected |
userData | Userdata which is passed back to func when it is invoked. |
- Returns
0 if successful, non-zero if a function with this name already exists.
Note
currently you can only register functions in the global scope, and only if they don't already exist.