Garry's Mod Wiki

math.randomseed

  math.randomseed( number seed )

Description

Seeds the random number generator. The same seed will guarantee the same sequence of numbers each time with math.random.

For shared random values across predicted realms, use util.SharedRandom.

Usage of this function affects ALL random numbers in the game. This means that improper use (such as setting the seed to a static value that doesn't change with time) can negatively affect other addons or the base game.

It is a good idea to set the seed back to at least something like SysTime in those cases.

Arguments

1 number seed
The new seed