RandomFloat: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server & Client|1.0}} | {{Info|Function|Server & Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Get a pseudo-random float. Negative ranges are supported as of v1.0.2.}} | ||
{{FuncSyntax|RandomFloat([, Min, Max])}} | {{FuncSyntax|RandomFloat([, Min, Max])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParamOptional|Min| | {{FuncParamOptional|Min|The minimum float.}} | ||
{{FuncParamOptional|Max| | {{FuncParamOptional|Max|The maximum float.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the random float between the range.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
RandomFloat(0, 10) -- Returns a number between 0 to 10 | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[Random]] |
Latest revision as of 10:48, 6 January 2020
Description
Get a pseudo-random float. Negative ranges are supported as of v1.0.2.
Syntax
RandomFloat([, Min, Max])
Parameters
- Min (optional)
The minimum float. - Max (optional)
The maximum float.
Return Value
- Returns the random float between the range.
Example
RandomFloat(0, 10) -- Returns a number between 0 to 10