Making things happen when a ConVar Value is 1

Hi,

I want players to have their Weapons stripped and gain a Crowbar when the Crowbar_Crazy Convar is set to one and all Weapons for Classes replaced with a Crowbar. How would I do that?

**[Cvars.AddChangeCallback

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Cvars.AddChangeCallback)**

If the convar already exists then something like the following.

[lua]
if( string.match(GetConVarString(“crowbar_crazy”), “1”) ) then
–(whatever the crap is to strip a player then something like)

ply:give “weapon_crowbar” – or something along those lines
[/lua]