Use
Onactivate>client>ifvalue><var:client:score> >= (COST)
Iftrue>player>additem>item
iffalse>client>centerprint> <color:ffffff><font:arial:20>You can not afford this item! It costs <color:00ffff> (COST)
Fill in the gaps since these aren't the precise event names.