Garry's Mod Wiki


  number TimedSin( number frequency, number origin, number max, number offset )


Returns a sine value that fluctuates based on CurTime. The value returned will be between the start value plus/minus the range value.

The range arguments don't work as intended. The existing (bugged) behavior is documented below.


1 number frequency
The frequency of fluctuation, in
2 number origin
The center value of the sine wave.
3 number max
This argument's distance from origin defines the size of the full range of the sine wave. For example, if origin is 3 and max is 5, then the full range of the sine wave is 5-3 = 2. 3 is the center point of the sine wave, so the sine wave will range between 2 and 4.
4 number offset
Offset variable that doesn't affect the rate of change, but causes the returned value to be offset by time


1 number
Sine value