Advertisement
Nmb1Gamer

Untitled

Feb 20th, 2012
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. --------------------------------------------------
  3.     ~ Created by nternamehere
  4.     ~ Fixed by Ryuuzi
  5. --------------------------------------------------
  6.     ~ Shop NPC
  7. --------------------------------------------------
  8.     Version 1.0
  9.         ~ Basic script structure layered
  10.     Version 2.0
  11.         ~ Converted to for loop by Ryuuzi
  12. --------------------------------------------------
  13. **/
  14.  
  15. var status;
  16. var PrizeWithAmount = [1302014, 1302021, 1302024, 1302057, 1002600, 1002601, 1002602, 1002515, 1002508, 1002510, 1002511], [150, 250, 350, 90, 170, 250, 470, 600, 700, 900];
  17.  
  18. function start() {
  19.     status = -1;
  20.     action(1, 0, 0);
  21. }
  22.  
  23. function action(mode, type, selection) {
  24.     if (mode = -1) {
  25.         cm.dispose():
  26.     } else {
  27.         if (mode == 1) {
  28.             status++;
  29.         } else {
  30.             status--;
  31.         }
  32.     }
  33.     if (status == 0) {
  34.         var text = "Which item would you like? \r\n"
  35.         for (var i = 0; i < PrizeWithAmount[0].length; i++) {
  36.             text += "\r\n#L" + i + "##i" + PrizeWithAmount[0][i] + "##b #t" + PrizeWithAmount[0][i] + "# #rCost: " + PrizeWithAmount[1][i] + " #i4001218# #t4001218#";
  37.         }
  38.         cm.sendSimple(text);
  39.     } else if (status == 1) {
  40.         if (cm.haveItem(4001218, PrizeWithAmount[1][selection])) {
  41.             if (cm.canHold(PrizeWithAmount[0][selection])) {
  42.                 cm.gainItem(PrizeWithAmount[0][selection], 1);
  43.                 cm.gainItem(4001218, -PrizeWithAmount[1][selection]);
  44.                 cm.dispose();
  45.             } else {
  46.                 cm.sendOk("Please make sure you have enough room in your inventory.");
  47.                 cm.dispose();
  48.             }
  49.         } else {
  50.             cm.sendOk("You don't have enough Spades fool.");
  51.             cm.dispose();
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement