Es rand

From EventScripts Community Encyclopedia


Overview

Syntax: es_rand <variable> <min> <max>

Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Variation of this command that doesn't expand variables: es_xrand

Description

Creates a random integer between min and max


Parameters

  • variable - a variable where you wish to store the integer
  • min - the smallest number you wish to get
  • max - the largest number you wish to get


Examples

// Resets the var
es_setinfo myvar 0
// Makes the number random between 1 and 100
es_rand myvar 1 100
// Message the number
es_msg #multi The random number was #green server_var(myvar)#default !


Notes

  • This will only return an integer.


See also


blog comments powered by Disqus