View difference between Paste ID: ELYx20pZ and u2SeHstE
SHOW: | | - or go back to the newest paste.
1-
var item = 4001218
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-
    if (mode == 1) { 
10+
	Version 2.0
11-
        status++; 
11+
		~ Converted to for loop by Ryuuzi
12-
    }else{ 
12+
--------------------------------------------------
13-
        status--; 
13+
**/
14-
    } 
14+
15-
 if (status == 0) {
15+
16-
    	cm.sendSimple("Which item would you like? \r\n #L0# Old Gladius(150 spade)#l\r\n #L1# Pico Pico Hammer(250) #l\r\n #L2# Newspaper Sword(350)#l\r\n #L3# The Stars And Stripes(500)#l\r\n #L4# Red Maple Bandana(90)#l\r\n #L5# Yellow Maple Bandana(170)#l\r\n #L6# Blue Maple Bandana(250)#l\r\n #L7# White Maple Bandana(470)#l\r\n #L8# lvl 0 Maple Hat(600)#l\r\n #L9# lvl 30 Maple Hat(700)#l\r\n #L10# lvl 70 Maple Hat(900)#l"); 
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-
 } else if (status == 1) {  
18+
19-
    if (selection == 0) {
19+
20-
      if(cm.haveItem(item, 250)) {    
20+
21-
	cm.gainItem(1302014, 1); 
21+
22-
	cm.gainItem(item, -150);
22+
23-
	cm.dispose();
23+
24-
    } else {
24+
    if (mode = -1) {
25-
	cm.sendSimple("You don't have enough spades, fool.");
25+
		cm.dispose():
26-
        cm.dispose();
26+
	} else {
27-
        }
27+
		if (mode == 1) {
28-
    } else if (selection == 1){  
28+
			status++;
29-
     if(cm.haveItem(item, 250)) { 
29+
		} else {
30-
        cm.gainItem(1302021, 1); 
30+
			status--;
31-
	cm.gainItem(item, -250);
31+
		}
32-
	cm.dispose();
32+
	}
33-
    } else {
33+
	if (status == 0) {
34-
	cm.sendSimple("You don't have enough spades, fool.");
34+
		var text = "Which item would you like? \r\n"
35-
        cm.dispose();
35+
		for (var i = 0; i < PrizeWithAmount[0].length; i++) {
36-
        }
36+
			text += "\r\n#L" + i + "##i" + PrizeWithAmount[0][i] + "##b #t" + PrizeWithAmount[0][i] + "# #rCost: " + PrizeWithAmount[1][i] + " #i4001218# #t4001218#";
37-
    } else if (selection == 2) { 
37+
		}
38-
        if (cm.haveItem(item, 350)) { 
38+
		cm.sendSimple(text);
39-
        cm.gainItem(1302024, 1); 
39+
	} else if (status == 1) {
40-
	cm.gainItem(item, -350);
40+
		if (cm.haveItem(4001218, PrizeWithAmount[1][selection])) {
41-
	cm.dispose();
41+
			if (cm.canHold(PrizeWithAmount[0][selection])) {
42-
    } else {
42+
				cm.gainItem(PrizeWithAmount[0][selection], 1);
43-
	cm.sendSimple("You don't have enough spades, fool.");
43+
				cm.gainItem(4001218, -PrizeWithAmount[1][selection]);
44-
        cm.dispose();
44+
				cm.dispose();
45-
    }
45+
			} else {
46-
    } else if (selection == 3) { 
46+
				cm.sendOk("Please make sure you have enough room in your inventory.");
47-
     if(cm.haveItem(item, 350)) { 
47+
				cm.dispose();
48-
        cm.gainItem(1302057, 1); 
48+
			}
49-
	cm.gainItem(item, -350);
49+
		} else {
50-
	cm.dispose();
50+
			cm.sendOk("You don't have enough Spades fool.");
51-
    } else {
51+
			cm.dispose();
52-
	cm.sendSimple("You don't have enough spades, fool.");
52+
		}
53-
        cm.dispose();
53+
	}
54-
        }
54+