Just put in this:
NPC Code:
if (fillinglagsnormallyneededforbuyinghere&&!isweapon ) {
if (hasweapon(weaponname) {
setcharprop #c,Sorry you already have this item!;
}
else {
toweapons weaponname;
optionalextrascriptthingshere;
}
}
And then from here on whatever you had already scripted.