Why seeds do not work for Random.new()?

After typing math.randomseed(1231) and input the seed inside (ex: 1231) all the math.random() will output same numbers each time I run the game.
like example if the seed is 1231 and the variable is math.random(1,2) every time i run the game it outputs 1,1,2

But when giving seed to Random.new(1231) every time i run the game it outputs different number
example with Random.new(1231):NextNumber(0.1,0.2):
(first run) 0.167… 0.139… 0.155… (second run) 0.178… 0.111… 0.175…

2 Likes

Strange, I couldn’t reproduce the issue.

print(Random.new(1231):NextNumber(.1, .2)) --> 0.15060909326880056
print(Random.new(1231):NextNumber(.1, .2)) --> 0.15060909326880056
print(Random.new(1231):NextNumber(.1, .2)) --> 0.15060909326880056
local random = Random.new(1231)
-- Same every run:
print(random:NextNumber(.1, .2)) --> 0.15060909326880056
print(random:NextNumber(.1, .2)) --> 0.10423167942845986
print(random:NextNumber(.1, .2)) --> 0.13339665671929057
2 Likes

Can you show your code?

Works for me

1 Like