A clickable item to zeny and some command

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
Hi all.
A simple request from me.

Player A have 100m. Then player A type commands for example @convert then the 100m turn into 10 pieces of mithril coin (674)

and when player A click the mithril coin (674), he will get 10m per pieces.

 
@@mrlongshen

Add this NPC:

- script ZENY_TO_MITHRIL_COIN -1,{ OnInit: bindatcmd("convert", "ZENY_TO_MITHRIL_COIN::OnConvert"); end; OnConvert: if( Zeny < 10000000 ) { dispbottom "You need atleast 10.000.000z to get Mithril Coins."; end; } .@coinCount = Zeny / 10000000; Zeny -= .@coinCount * 10000000; getitem Mithril_Coin, .@coinCount;}function  script  convert  {  .@coinCount = countitem(Mithril_Coin);  if( !.@coinCount ) {    dispbottom "You need atleast 1 Mithril Coin to get 10.000.000z.";    end;  }      delitem Mithril_Coin, .@coinCount;  Zeny += .@coinCount * 10000000;}
afterwards make Mithril Coin usable and use this as item script:

Code:
callfunc("convert");
 
@@Winterfox

Hi miss. I have test this script..

I think the script problem..

Read the condition

1. I have 1b and and I convert, then I get 100 mithril coin

2. When I click the 100 mithril coin, its convert my coin to zeny back, however I should get the 1b back, but I get 990m.

  • Can you make clickable one by one the mithril coins, so I will get 10m each, instead convert all in directly.. 

Thanks you.

 
Code:
{	Id: 674	AegisName: "Mithril_Coin"	Name: "Mithril Coin"	Type: 0	Buy: 5000	Weight: 40	Script: <" Zeny += 10000000; ">},
 
@@Emistry Thanks its working
default_smile.png
+1

 
Back
Top