Random (script event)

Game class

This event operates on an instance of the game class type {{{gameclass}}}

Description

Returns a random value X where 0 <= X < range.

Usage

float random( float range )

Parameters

  • [range] - a number value that represents the largest possble value to be returned.

Examples

This example generates a random number between min and max

 
float min = 10;
float max = 20;
 
float rand = min + sys.random(max - min);

Notes

Returns the same set of random numbers every time the game is run. Just change the seed for a different set of numbers.