Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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.
Patch changes[]
Patch 10.0.0 (2022-10-25): Removed scriptCVar
argument.
Patch 8.1.5 (2019-03-12): Namespaced to C_CVar.SetCVar
.
Patch 1.0.0 (2004-10-08): Added.