RandomInt - Utility

Revision as of 15:51, 26 October 2011 by imported>Jlundin
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: Utility Script

Generates a random integer between the minimum and maximum values (inclusive).

SyntaxEdit

int Function RandomInt(int aiMin = 0, int aiMax = 100) native global

ParametersEdit

  • aiMin: The minimum value for the random integer.
    • Default: 0
  • aiMax: The maximum value for the random integer.
    • Default: 100

Return ValueEdit

A random integer between aiMin and aiMax (inclusive)

ExamplesEdit

; Get a random number between 0 and 100
int random = Utility.RandomInt()


; Get a random number between 0 and 10
int random = Utility.RandomInt(0, 10)

See AlsoEdit