Return to Main Docs Page

CreateConVar

NewerShared.png ConVar CreateConVar(name, value, flags, helptext, min, max)

Description:



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

Arguments:



  • 1) string name
  • Name of the ConVar.

  • 2) string value
  • Default value of the ConVar. Can also be a number.

  • 3) number or table flags
  • Flags of the convar, see FCVAR enum.

  • 4) string helptext
  • The help text to show in the console.

  • 5) string min
  • If set, the ConVar cannot be changed to a number lower than this value.

  • 5) string max
  • If set, the ConVar cannot be changed to a number higher than this value.

Returns:



Example:



local checkBool = CreateConVar("gmed_giveweapons", "1", FCVAR_CLIENT, "Give weapons?", "0", "1")
                  
if checkBool:GetBool() == true then
   print("ConVar is Working!")
end