Math.random different for every client

Hello, how can I use math.random so it be same for every client?

If you set the seed, they will all generate the same sequence of random numbers. But they might be offset to each other depending on when you generate numbers on each. You can set this with math.randomseed or using a Random object and passing the seed to the Random.new function.

2 Likes

Mind you, by setting a seed on the client, you completely eliminate the unpredictability of your pseudo-random generated numbers. If you’re using these numbers in sensitive areas of your codebase, such a random item unboxing, an exploiter could easily determine what rolls would produce what outputs

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