C_CVar.SetCVar

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Patch
Added in 8.1.5 / 2.5.1 / 1.14.0

Sets a console variable.

success = C_CVar.SetCVar(name [, value])
        = SetCVar

Arguments

name
string : CVar - Name of the CVar.
value
string|number? = "0" - The new value of the CVar.

Returns

success
boolean - Whether the CVar was successfully set. Returns nil if attempting to set a secure cvar in combat.

Details

  • Some settings require a reload/relog before they take effect.
  • CVars are not saved to Config.wtf until properly logging out or reloading the game.
  • Secure CVars cannot be set in combat and only with SetCVar instead of /console.
  • Character and Account specific variables are stored server-side depending on CVar synchronizeConfig.

See Also

Patch changes