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 » Game Design
Home Search
 

Re: math.random is returning the same value

Previous Thread :: Next Thread 
IanVIII is not online. IanVIII
Joined: 03 Apr 2016
Total Posts: 535
25 Jun 2016 08:31 AM
local PrimaryNoiseNumber = math.random(50,250)
print("Terrain Number: "..PrimaryNoiseNumber)

For some reason, whenever I run the script, I get the number 227.
Can someone please explain this to me?
Report Abuse
IanVIII is not online. IanVIII
Joined: 03 Apr 2016
Total Posts: 535
25 Jun 2016 08:33 AM
It's doing the same thing when I change the numbers, I got 136 when I changed 250 to 260
Report Abuse
zzxWarrior is not online. zzxWarrior
Joined: 18 Aug 2010
Total Posts: 3730
25 Jun 2016 09:16 AM
(Haven't learnt a lot of scripting in forever but)

It could be that you need to create a new IntValue, and then make that IntValue have the random number.


Join the unofficial game design group, https://www.roblox.com/My/Groups.aspx?gid=2862545
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
25 Jun 2016 09:30 AM
math.randomseed(math.random(os.time()))

put that as ur first line
Report Abuse
zzxWarrior is not online. zzxWarrior
Joined: 18 Aug 2010
Total Posts: 3730
25 Jun 2016 09:41 AM
@above

Why we he need to have the person's pc time?

It makes no sense.


Join the unofficial game design group, https://www.roblox.com/My/Groups.aspx?gid=2862545
Report Abuse
zzxWarrior is not online. zzxWarrior
Joined: 18 Aug 2010
Total Posts: 3730
25 Jun 2016 09:42 AM
correction:

date and time.


Join the unofficial game design group, https://www.roblox.com/My/Groups.aspx?gid=2862545
Report Abuse
IanVIII is not online. IanVIII
Joined: 03 Apr 2016
Total Posts: 535
25 Jun 2016 09:44 AM
It worked, but I need it to get a number between 50 and 250
When I try and do the same again, it would generate a different number but it would still be the same every time I run it.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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