math.randomseed(tick()); print(math.random(30000))

I have these two lines of code in two separate scripts, but every time, without fail, they both print the same number. I even tried typing random numbers inside each tick(), but nothing improved. What am I doing wrong here, and how can I fix it? Thanks!

6 comments

0

Multiple randomseeds with the same value will always produce the same number sequence. Even with just one, Randomseed only uses the integer part of the number, so everytime it runs, it’s effectively starting with the same number.  

0

You could try “math.randomseed(tick() * 1000)”

0

You could also use NextInteger(min, max) or NextNumber(min, max)

0

Thanks so much - I'll try that out!

0

I usually use crazy equations in my randomseeds that I just think of while I am doing stuff. I also usually use math.random() inside of the math.randomseed(). Not sure how effective that is but it's what I've been doing and it seems to work.

0

You only need to run 'math.randomseed' once for the entire place and it'll be set for all scripts