Garry's Mod Wiki

cvars.Number

  number cvars.Number( string cvar, any default = nil )

Description

Retrieves console variable as a number.

Arguments

1 string cvar
Name of console variable
2 any default = nil
The value to return if the console variable does not exist

Returns

1 number
Retrieved value or the second argument if the console variable does not exist. Will return 0 if the console variable exists and has a string value.