User Tools

Site Tools


random_number

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
random_number [2018/08/29 09:05] justinrandom_number [2020/02/04 20:20] justin
Line 2: Line 2:
 ---- ----
  
-The **random number** syntax generates an integer value within the given range (inclusive of the minimum and maximum value). It can be used in place of a literal value for most function arguments where a numeric value is expected.+The **random number** syntax generates an integer value within the given range (inclusive of the minimum and maximum value). It can be used in scripts anywhere a numeric value is expected.
  
 ====Examples:==== ====Examples:====
-<code lua>+<code bauxite>
 wait(random(1, 5)) wait(random(1, 5))
 </code> </code>
 Waits for a random amount of time between 1 and 5 seconds. Waits for a random amount of time between 1 and 5 seconds.
  
-<code python>+<code bauxite>
 if random(0, 100) <= 25 then if random(0, 100) <= 25 then
   give_item("ITEM_0001")   give_item("ITEM_0001")
random_number.txt · Last modified: 2020/05/26 10:35 by justin