generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Pick a random number.

Previous Thread :: Next Thread 
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Feb 2014 07:36 PM
I'm trying to make it have a 10% change to change the value of a Number vale to 10

while wait(10) do
number = math.random()
if number == 10 then

end
end
Report Abuse
ALERIFICALNEUMORAITI is not online. ALERIFICALNEUMORAITI
Joined: 21 Nov 2010
Total Posts: 302
09 Feb 2014 07:40 PM
k so
math.random() alone only returns a number between 0-1, so, you can imagine this coming from it:
0.34754834954

And things like that.

But if you do:
number = math.random(1,10)
it will choose a number in between 1 and 10 randomly.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Feb 2014 07:41 PM
Oh wait a DUR... I was stupid right there I thought I was going to have to use a table. wtf.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
09 Feb 2014 07:44 PM
6 is my number
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image