Functions are units of code that perform a specific task. The general format of a function is as follows:

returntype functionname(type parameter1, type parameter2... )
   code within the function
The return type defines the type (int, float, etc.) of variable that is returned when the function is executed. All code paths in the function must return this type of variable in order for the script to compile. A function can return any data type, or nothing, which is indicated with the 'void' keyword.
The function name is used to identify the function. Different functions may share the same name as long as their parameters are not identical. This is called overloading a function.
Parameters are variables that are supplied to the function when the function is called. They may be used as defined variables inside the function.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.