You can do it like what kobe said, or you can use Score, as in the default score that when you open the player list you see.
You need the mod Variables, VCE works but it is a tad, not much, more complicated.
If you are going to use Variables V4 this is a good formula. Score is easier to use.
If you are using score, your score goes up when you kill a zombie unless the mini game creator changes it.
If the mini game creator didn't change it, use this for the gun case:
Onactivate>self>ifplayerscore>Greater Equals> (However much score you want it to cost)
Onvariablefalse>client>Centerprint(or chat or bottom)>You don't have enough score!
Onvariabletrue>client>incscore>-(The amount you want it to cost, make sure you use -)
Onvariabletrue>player(or self)> additem(or spawnitem)> (The Weapon you want)
Onvariabletrue>client>Centerprint(or chat or bottom)>You got a (Weapon name)!
If you are using VCE it will make it take a few extra moments
Here is the events for the gun case using score:
Onactivate>client>VCEIfVariable> <var:client(or cl):score> >= (However much you want it)
Onvariablefalse>client>centerprint(or chat or bottom) You don't have enough score for this!
Onvariabletrue>player(or self for spawnitem)>additem(or spawnitem for self) (Item)
Onvariabletrue>client>incscore> (However much the item costs)
Onvariabletrue>client>CenterPrint(or chatmessage or bottom) You spent (Cost) score on (item)!
Hope that helps!