Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- --------------------------------------------------
- ~ Created by nternamehere
- ~ Fixed by Ryuuzi
- --------------------------------------------------
- ~ Shop NPC
- --------------------------------------------------
- Version 1.0
- ~ Basic script structure layered
- Version 2.0
- ~ Converted to for loop by Ryuuzi
- --------------------------------------------------
- **/
- var status;
- var PrizeWithAmount = [1302014, 1302021, 1302024, 1302057, 1002600, 1002601, 1002602, 1002515, 1002508, 1002510, 1002511], [150, 250, 350, 90, 170, 250, 470, 600, 700, 900];
- function start() {
- status = -1;
- action(1, 0, 0);
- }
- function action(mode, type, selection) {
- if (mode = -1) {
- cm.dispose():
- } else {
- if (mode == 1) {
- status++;
- } else {
- status--;
- }
- }
- if (status == 0) {
- var text = "Which item would you like? \r\n"
- for (var i = 0; i < PrizeWithAmount[0].length; i++) {
- text += "\r\n#L" + i + "##i" + PrizeWithAmount[0][i] + "##b #t" + PrizeWithAmount[0][i] + "# #rCost: " + PrizeWithAmount[1][i] + " #i4001218# #t4001218#";
- }
- cm.sendSimple(text);
- } else if (status == 1) {
- if (cm.haveItem(4001218, PrizeWithAmount[1][selection])) {
- if (cm.canHold(PrizeWithAmount[0][selection])) {
- cm.gainItem(PrizeWithAmount[0][selection], 1);
- cm.gainItem(4001218, -PrizeWithAmount[1][selection]);
- cm.dispose();
- } else {
- cm.sendOk("Please make sure you have enough room in your inventory.");
- cm.dispose();
- }
- } else {
- cm.sendOk("You don't have enough Spades fool.");
- cm.dispose();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement