Truly Random Numbers: Difference between revisions

From ROBLOX Wiki
Jump to navigationJump to search
Created page with "{{CatUp|Tutorials}} __TOC__ == Introduction == This tutorial covers random numbers. == Random number generator == The random number generator in Roblox generates random numbers. * Start Roblox Studio. * Insert > Object > Script. * Copy and Paste the following script into the newly created Script Object: <pre> for i = 1, 10 do -- this will create a loop which will run 10 times print(math.random(1,100)) -- this will print random number from 1 to 100 wait(1) -- t..."
 
Redirected page to Random numbers
Tag: New redirect
 
Line 1: Line 1:
{{CatUp|Tutorials}}
#REDIRECT [[Random numbers]]
__TOC__
 
== Introduction ==
 
This tutorial covers random numbers.
 
== Random number generator ==
 
The random number generator in Roblox generates random numbers.
 
* Start [[Roblox Studio]].
* Insert > Object > Script.
* Copy and Paste the following script into the newly created Script Object:
 
<pre>
for i = 1, 10 do -- this will create a loop which will run 10 times
print(math.random(1,100)) -- this will print random number from 1 to 100
wait(1) -- this will wait 1 second
end -- end of the loop
</pre>
 
If math.random() was used, any number would appear.
 
== See Also ==
 
[http://en.wikipedia.org/wiki/Random_number_generator Random Number Generator]
 
[[Category:Scripting Tutorials]]

Latest revision as of 23:44, 10 December 2024

Redirect to: