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 » Scripters
Home Search
 

Re: Making math.random A Bit More Random?

Previous Thread :: Next Thread 
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
14 Jan 2017 11:58 PM
I have noticed that math.random, especially when grabbing maps or players, is not really as random as I had hoped. Usually one of the same players, or the same 2 maps always load.

Is there another alternative?
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
15 Jan 2017 12:00 AM
If I had a dollar for every one of these thread...

This is your impression from testing in studio, yes?
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
15 Jan 2017 12:00 AM
Yes, I believe so, it has been happening in the actual client to.
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
15 Jan 2017 12:02 AM
https://forum.roblox.com/Forum/ShowPost.aspx?PostID=205738421
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
15 Jan 2017 12:08 AM
Okay...and...is there anyway to help this problem?
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
15 Jan 2017 12:10 AM
the tl;dr is tick() is not a good seed in the short term.

tick()%1*1e6 is a good seed in the short term
Report Abuse
BlockDeleted is not online. BlockDeleted
Joined: 31 May 2014
Total Posts: 291
15 Jan 2017 12:11 AM
you could do m = math.random (1, 100)

then have if m >=1 and m = <= 50 then

so instead of it being math.random(1,2)

get it or no?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
15 Jan 2017 12:12 AM
ew
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
15 Jan 2017 12:13 AM
You've missed the mark @BlockDeleted
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
15 Jan 2017 12:28 AM
Even I know not to do that @BlockDelted
Report Abuse
booing is not online. booing
Joined: 04 May 2009
Total Posts: 6594
15 Jan 2017 01:10 AM
And thats not even even..
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
15 Jan 2017 02:14 AM
I use this:

string.reverse(tostring(tick()%1*1e6))
Report Abuse
Chedder923 is not online. Chedder923
Joined: 10 Jul 2012
Total Posts: 103
15 Jan 2017 02:26 AM
use probability?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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