Math: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
m (add math.randomseed(os.time()) tip)
Line 25: Line 25:
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.rad math.rad]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.rad math.rad]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.random math.random]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.random math.random]
Do this beforehand to improve randomness:
<syntaxhighlight lang="lua">math.random(os.time())</syntaxhighlight>
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.randomseed math.randomseed]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.randomseed math.randomseed]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sin math.sin]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sin math.sin]

Revision as of 11:36, 28 February 2023

Math is a built-in Lua library which contains mathematical functions and constants that you can use in scripts.

Do this beforehand to improve randomness:

math.random(os.time())

See Also