Jump to content
  • 0

Coins to coins changer...


Gelo

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   1
  • Joined:  05/10/12
  • Last Seen:  

I'm trying to make a coins to coins ex-changer but it doesn't work..

NPC should be like this:

25 Poring Coins = 1 Bronze Coin

5 Bronze Coins = 1 Silver Coin

5 Silver Coins = 1 Gold Coin

5 Gold Coins = 1 Platinum coin.

Then..

The NPC will ask the user how many coins he wants to exchange.

My Script:

prontera,158,326,4 script Event Coin Changer 822,{
mes "[Event Coins Changer]";
mes "Hi ^ff8000"+strcharinfo(0)+"^000000, I can exchange your coins to higher coins.";
mes "25 Poring Coins(PC)+ = 1 Bronze Coin(BC)";
mes "5 Bronze Coin(BC) = 1 Silver Coin(SC)";
mes "5 Silver Coin(SC) = 1 Gold Coin(GC)";
mes "5 Gold Coin(GC) = 1 Platinum Coin(Plat)";
mes "What would you like to do?";
switch(select("25PC = 1BC","5BC = 1SC","5SC = 1GC","5GC = 1Plat",)) {

case 1:
 if (countitem(7539) < 25) goto L_NE;
 delitem 7539,25;
 getitem 673,1;
 close;
case 2:
 if (countitem(673) < 5) goto L_NE;
 delitem 673,5;
 getitem 675,1;
 close;
case 3:
 if (countitem(675) < 5) goto L_NE;
 delitem 675,5;
 getitem 671,1;
 close;
case 4:
 if (countitem(675) < 5) goto L_NE;
 delitem 675,5;
 getitem 671,1;
 close;
}
}

Now i want to add the NPC Will ask how many coins he/she wants to exchange..

Edited by .- Versiglia -.
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   1
  • Joined:  06/03/12
  • Last Seen:  

try this and sorry for my english.


prontera,158,326,4 script Event Coin Changer 822,{
mes "[Event Coins Changer]";
mes "Hi ^ff8000"+strcharinfo(0)+"^000000, I can exchange your coins to higher coins.";
mes "25 Poring Coins(PC)+ = 1 Bronze Coin(BC)";
mes "5 Bronze Coin(BC) = 1 Silver Coin(SC)";
mes "5 Silver Coin(SC) = 1 Gold Coin(GC)";
mes "5 Gold Coin(GC) = 1 Platinum Coin(Plat)";
mes "What would you like to do?";
next;
switch(select("PC to BC","BC to SC","SC to GC","GC to Plat",)) {

case 1:
mes "How many you want to exchange?";
next;
input .@count;
if (.@count == 0) close; // optional: if player enter 0 script will terminate
if (countitem(7539) < .@count*25) goto L_NE;
delitem 7539,.@count*25;
getitem 673,.@count;
close;
case 2:
mes "How many you want to exchange?";
next;
input .@count;
if (.@count == 0) close; // optional: if player enter 0 script will terminate
if (countitem(673) < .@count*5) goto L_NE;
delitem 673,.@count*5;
getitem 675,.@count;
close;
case 3:
mes "How many you want to exchange?";
next;
input .@count;
if (.@count == 0) close; // optional: if player enter 0 script will terminate
if (countitem(675) < .@count*5) goto L_NE;
delitem 675,.@count*5;
getitem 671,.@count;
close;
case 4:
mes "How many you want to exchange?";
next;
input .@count;
if (.@count == 0) close; // optional: if player enter 0 script will terminate
if (countitem(671) < .@count*5) goto L_NE;
delitem 671,.@count*5;
getitem 677,.@count;
close;
}

L_NE:
mes "You don't have that coin enough.";
close;
}

Edited by volk
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  56
  • Reputation:   1
  • Joined:  05/10/12
  • Last Seen:  

Thanks for this :)

Btw, 1 more thing, I want to also make a vice versa for this. if you can also help me with that, Much appreciated :))

Thank you so much! :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...