shop NPC

any one no a script for a shop npc that can sell weapons/anything?

Re: shop NPC

Shop NPCs are a bit different on graal, especially without 'addweapon weapon;'. However, you can quite easily use the method done by all people back in the day before fancy shit and lack of functionality was the norm.

Heres a very dumbed down version.

if(playerenters) {setimg block.png;} //Assuming you have an image called block.png, set the NPC's image to it.

if(playertouchsme) say2 Say "Buy this" to buy me.#bOnly 50 gralat.; //Simple sign to tell the price and command.

if(playerchats && strequals(#c,Buy this)){ // Player says "buy this"
 if(!hasweapon(weaponname)){ //Only buy if they don't have "weaponname"
  if(playerrupees >= 50) { //Check if they have 50 gralat or more.
   toweapons weaponname; //Add the weapon (this whole NPC) as 'weaponname'
   playerupees -= 50; //Deduct gralat.
  }
 }
}

if(weaponfired) { //Actual Weapon code for when used.
 setplayerprop #c,zOMG my head is on fire!;
 setani carry,;
}