Initiates a public, server-side "dice roll". Used in the default UI to implement the /roll chat command; when called, the server generates a random integer and sends it to the player and all others nearby (or in the same party/raid) via a CHAT_MSG_SYSTEM event. (The server message is formatted according to the global RANDOM_ROLL_RESULT; e.g. "Leeroy rolls 3 (1-100)".)

For random number generation that does not involve the server or send visible messages to other clients, see math.random.


See also Chat functions.

Signature:

RandomRoll(min, max)

Arguments:

  • min - Lowest number to be randomly chosen (number,string)
  • max - Highest number to be randomly chosen (number,string)
This function must query the remote server, and any results will not be immediately available to the game client. Please see the function's documentation for more information about how to retrieve any results.