Garry's Mod Wiki



  ConVar CreateConVar( string name, string value, number flags = FCVAR_NONE, string helptext, number min = nil, number max = nil )


Creates a console variable (ConVar), in general these are for things like gamemode/server settings.


1 string name
Name of the ConVar.

This cannot be a name of an engine console command or console variable. It will silently fail if it is. If it is the same name as another lua ConVar, it will return that ConVar object.

2 string value
Default value of the convar. Can also be a number.
3 number flags = FCVAR_NONE
Flags of the convar, see Enums/FCVAR, either as bitflag or as table.
4 string helptext
The help text to show in the console.
5 number min = nil
If set, the ConVar cannot be changed to a number lower than this value.
6 number max = nil
If set, the ConVar cannot be changed to a number higher than this value.


1 ConVar
The convar created.

Special Pages



Render Time: 29ms

DB GetPage 2
Generate Html 10
SaveChanges (1) 6
Render Body 0
Render Sidebar 8