From Game Editor
rand is one of the simpler functions. It takes what value you enter and returns a random number between 0 and your value.
Example:
int a; a = rand(5);
The function returns a value that is equal to a random number from 0 to 4. Remember that rand by default returns a double and treats your supplied value as a double.