PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

Random

Random

Constructors

Random.new ( number seed )

Creates a new Random object. If the seed parameter is not specified, it will use a seed pulled from an internal entropy source.

Functions

int Random:NextInteger ( int min, int max )

Returns a pseudorandom integer uniformly distributed over [min, max].

number Random:NextNumber ( )

Returns a pseudorandom number uniformly distributed over [0, 1).

number Random:NextNumber ( number min, number max )

Returns a pseudorandom number uniformly distributed over [min, max).

Vector3 Random:NextUnitVector ( )

Returns a unit vector with a pseudorandom direction. Vectors returned from this
function are uniformly distributed over the unit sphere.

Random Random:Clone ( )

Returns a new Random object with the same state as the original.