Random numbers: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker
No longer applicable. See discussion.
>Mindraker
m an improved tutorial
Line 1: Line 1:
{{CatUp|Tutorials}}
{{CatUp|Tutorials}}
__TOC__
__TOC__
== Introduction ==
This tutorial covers random numbers.


== Random number generator ==
== Random number generator ==


The random number generator in Roblox does seem to generate random numbers.  
The random number generator in Roblox generates random numbers.  
Insert this script into your place:<br/>
 
* Start [[Roblox Studio]].
* Insert > Object > Script.
* Copy and Paste the following script into the newly created Script Object:
 
<pre>
<pre>
for i = 1, 10 do
for i = 1, 10 do -- this will create a loop which will run 10 times
print(math.random(1,100))
print(math.random(1,100)) -- this will print random number from 1 to 100
wait(1)
wait(1) -- this will wait 1 second
end
end -- end of the loop
</pre>
</pre>



Revision as of 20:08, 28 September 2008

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:
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

See Also

Random Number Generator