City17
4 years
sets the internal PRNG's seed.
Useful for testing or when you want a repeatable outcome. WorldEdit has an option to run test maps with a fixed seed, you can achieve the same result with this.
Desyncs! The random number generator is a global, shared resource. Do not change its state in local blocks asynchronously.
See: GetRandomInt, GetRandomReal
Useful for testing or when you want a repeatable outcome. WorldEdit has an option to run test maps with a fixed seed, you can achieve the same result with this.
Code Select
1 SetRandomSeed(42)
2 GetRandomInt(0, 18) --> 12
3 GetRandomInt(0, 18) --> 2
4 SetRandomSeed(42)
5 GetRandomInt(0, 18) --> 12
6
Desyncs! The random number generator is a global, shared resource. Do not change its state in local blocks asynchronously.
See: GetRandomInt, GetRandomReal