Garry's Mod Wiki

Garry's Mod Wiki

  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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...