Return

return is a keyword that is used in Game Maker scripts. When this keyword is used, the script ends execution at the current line. return must always be followed by the result of an expression or a value. The script will return that value.

return ;

The following script returns the sum of two arguments passed to it:

return ( argument0 + argument1 );

Suppose we called the above script sum. Then we could use it like this:

myvar= sum (7,4);

The script will return the sum of 7 and 4. The value of myvar becomes 11.