Random: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
Line 14: Line 14:
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
Random(0, 10) -- Returns a number between 0 to 10
Random(0, 10) -- Returns a number between 0 to 10
<syntaxhighlight>
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
* [[RandomFloat]]
* [[RandomFloat]]

Latest revision as of 10:47, 6 January 2020

Random

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Get a pseudo-random number. Negative ranges are supported as of v1.0.2.

Syntax

Random([Min, Max])

Parameters

  • Min (optional)
    The minimum number.
  • Max (optional)
    The maximum number.

Return Value

  • Returns the random between the range.

Example

Random(0, 10) -- Returns a number between 0 to 10

See also