RandFloat: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function generates a random number between 0 and 1.
This function returns a random float between 0 and 1. This can act as a random on/off switch for something.


==Syntax==
==Syntax==
<syntaxhighlight lang="lua">randFloat ()</syntaxhighlight>
<syntaxhighlight lang="lua">float randFloat ()</syntaxhighlight>


===Required Arguments===
===Returns===
 
Returns a random number between 0 and 1 in a float.
''None.''


==Example==
==Example==
<syntaxhighlight lang="lua">outputChatBox ( "Random float: ", randFloat () )</syntaxhighlight>
This example outputs a random number in the chat box.
<syntaxhighlight lang="lua">outputChatBox ( "Random float: " .. randFloat () )</syntaxhighlight>


==See Also==
==See Also==
{{Utility functions}}
{{Utility functions}}

Revision as of 14:19, 14 August 2006