Math: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 26: Line 26:
* [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]
* [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]
Do this beforehand to improve randomness:
<syntaxhighlight lang="lua">math.randomseed(os.time())</syntaxhighlight>
* [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]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sinh math.sinh]
* [http://www.lua.org/manual/5.1/manual.html#pdf-math.sinh math.sinh]
Line 33: Line 37:


==See Also==
==See Also==
* [http://lua-users.org/wiki/MathLibraryTutorial Math examples on the LUA Wiki]
* [http://lua-users.org/wiki/MathLibraryTutorial Math examples on the Lua wiki.]


[[Category:Scripting Concepts]]
[[Category:Scripting Concepts]]


[[ar:Math]]
[[de:Math]]
[[de:Math]]
[[en:Math]]

Latest revision as of 07:49, 8 June 2024

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.randomseed(os.time())

See Also