Touch Lua Wiki
Advertisement

In Lua, the function variable is a variable that when called, will run the same piece of code from multiple places, without having to duplicate the code in multiple places.

To create a function, use the function keyword (for example, newFunction = function() print(newFunction) end).

Advertisement