Generate a completely random number while ignoring math.randomseed from earlier code?

Hey, so basically I am trying to run math.randomseed at the top of my code to generate a sort of complex “string”, but since it uses tick() it’s sort of delayed. This is where the problem comes in. Using math.random afterwards will use the same algorithm from earlier, which I don’t want it to do. So I thought of using Random.new(), however I’m afraid that using something like as follows

math.ceil(Random.new(math.sin(tick())*1e9):NextNumber(1, 10))

would be a bad decision as a whole since I tried it with 1, 2 and it would always print 2. Plus I don’t even know if it’s compatible with ignoring math.randomseed.

So, I need help with creating an algorithm that will generate any random number from a specified range, while ignoring math.randomseed. This means that simply using math.random will not work. Cheers!

Random ignores math.randomseed; it literally asks for a seed in the constructor.

What code was used for this?
If it was similar to the code you showed, that would make sense, since it would almost never choose 1.

Alright, then what should be the seed, or whats the default seed for math.random?

Figured out that I could just do Random.new() without a seed, and also use :NextInteger() instead of :NextNumber() so that something like 1, 2 would actually work.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.