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: Help with truly random numbers

Previous Thread :: Next Thread 
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
03 Jan 2015 01:38 AM
Is math.randomseed(tick())'s seed shared throughout all scripts?
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
03 Jan 2015 01:43 AM
no
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
03 Jan 2015 01:44 AM
Yes.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Jan 2015 01:45 AM
No its not
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
03 Jan 2015 01:48 AM
ok ill just run it in all the scripts ?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Jan 2015 01:48 AM
I would think so since 1 math table but idk
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
03 Jan 2015 01:55 AM
Scropt1
math.randomseed(5)

Scropt2
print(math.random(10000))

Execute Scropt1 then Scropt2 rinse n repeat

Output:
>17
>17
>17
Report Abuse
robomax11 is not online. robomax11
Joined: 07 Jul 2011
Total Posts: 6828
03 Jan 2015 01:56 AM
thx
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Jan 2015 02:01 AM
In one script
math.randomseed(1)
print(math.random(-999999999, 999999999)) -->-997497482



In a different test


In script1
math.randomseed(1)


In script2
wait(1)
print(math.random(-999999999, 999999999)) -->A random number
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
03 Jan 2015 02:15 AM
You are making sure to execute them right?
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Jan 2015 03:37 AM
If they didn't execute it wouldn't be printing...?
Report Abuse
DevUndead is not online. DevUndead
Joined: 24 Jul 2014
Total Posts: 558
03 Jan 2015 03:40 AM
It's not truely random tho ;)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
03 Jan 2015 05:01 AM
I'm talking about script1 without any prints.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Jan 2015 05:06 PM
Script 1 does not print anything
It just set the seed

I changed it to this

wait(1)
math.randomseed(1)




other script
wait(2)
print(math.random(-999999999, 999999999))



617481002
214331492
-997497482
-613391522



Thats from running it 4 times, 1 of them was the correct number o.O
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