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: rand # gen for games that use math.random quick

Previous Thread :: Next Thread 
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:30 PM
tonumber(tostring(tick()):sub(12))

this is sufficient

try

for i=1, 200 do
math.randomseed(tonumber(tostring(tick()):sub(12)))
print(math.random(1,5000))
end


i just had some problems with this before so i decided to release this
you're welcome
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Feb 2016 06:31 PM
Please tell me you're joking
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:31 PM
You don't understand how math.random works. You should only ever set the seed once.


Report Abuse
h5s is not online. h5s
Joined: 03 Jul 2014
Total Posts: 1229
14 Feb 2016 06:33 PM
math.randomseed(tick()) will suffice instead of... Whatever the hell you were trying to do.
Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:33 PM
@h5

no
Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:35 PM
@h5 try this in studio

for i=1, 200 do
math.randomseed(tick())
print(math.random(1,5000))
end

tell me what it outputs
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:35 PM
Actually, it will.

Seriously though, I agree with cnt.


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:36 PM
12103, what part of "DO NOT SET SEED MORE THAN ONCE OR YOU ARE DOING IT WRONG ALTOGETHER" do you not understand???


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:37 PM
if you're not going to give me an explanation for why i shouldn't seed more than once, then you should just stop posting.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:38 PM
Because seeding isn't meant to happen more than once. Give a reason why you SHOULD.


And this is also better.

math.randomseed(tick()%1*1e6)


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:39 PM
and then you'd do math.random 50 times in a second and they'd all be the same. nice. /s
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:40 PM
Are you trolling? Get a life and stop. It's not very funny.


Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Feb 2016 06:40 PM
"for i=1, 200 do
math.randomseed(tonumber(tostring(tick()):sub(12)))
print(math.random(1,5000))
end"


math.randomseed(tick())

for i = 1,200 do
print(math.random(1,5000))
end


Will provide better results.


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:41 PM
math.randomseed(tick()%1*1e6)
will provide even better results though


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:41 PM
no chi it will provide the same result every time
you guys don't listen
Report Abuse
Agluk15 is not online. Agluk15
Joined: 13 Feb 2016
Total Posts: 193
14 Feb 2016 06:41 PM
@12103net

With your IQ of 1, no wonder your near vegetable intelligence.

(Please let this start another ^ so I am famous lol)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:42 PM
Okay, you are just trolling. I'm abandoning this flame bait.


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:43 PM
"Okay, you are just trolling. I'm abandoning this flame bait."

wtf y no stay i need more material

@ag

smart /s
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
14 Feb 2016 06:44 PM
12103 is right. Random number generations via computer using a seed is pretty bad. They repeat a lot of patterns usually and can be studied and predicted with high accuracy.

http://random.org explains their goals.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:50 PM
Yeah, he's right in that sense, but that's not the point he is trying to prove. He is arguing that setting the seed over and over is better than setting it once and letting it do it's stuff.

And unless you're actually a robot, you won't be able to predict the numbers.


Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
14 Feb 2016 06:51 PM
https://www.youtube.com/watch?v=olZN3Qh_g04
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Feb 2016 06:52 PM
"And unless you're actually a robot, you won't be able to predict the numbers."
That's not true, all you have to do is look at the implementation of the random function.

Also cody you're dumb, predictability doesn't make it bad. it's good enough for almost all intents and purposes.
Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:52 PM
@jarod

sometimes it works setting the seed once
however, if you keep printing the numbers very, very quickly they aren't very different
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
14 Feb 2016 06:53 PM
It shouldn't make a difference the speed with which you draw the numbers, as far as I know. I don't think the algorithm is based on time.


Report Abuse
12103net is not online. 12103net
Joined: 08 Jul 2013
Total Posts: 350
14 Feb 2016 06:55 PM
it's happened to me before
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