<header>,{ for( set .@i, 1; .@i < getarraysize(.exchange); set .@i, .@i + 1 ) { set .@menu$, .@menu$ + " - " + "^0000ff" + getitemname(.exchange[.@i]) + "^000000"; set .@menu$, .@menu$ + ":"; // build menu. } set .@choice, select(.@menu$); mes "[ "+strnpcinfo(1)+" ]", "Exchange Rates : ", .cost[.@choice]+"x ^ff0000" + getitemname(.requirement[.@choice])+ "^000000 is to", "1x ^ff0000" + getitemname(.exchange[.@choice])+"^000000"; if ( select( "Exchange", "Later" ) == 2 ) close; mes "How many do you want to exchange?"; input .@input; // input how many items you want to exchange. if ( countitem(.requirement[.@choice]) < (.cost[.@choice] * .@input ) || .@input == 0) { // count if you have sufficient items to exchange. mes " ",.@input == 0?"Value is not accepted!":"I need ^ff0000"+ ( (.cost[.@choice] * .@input ) - countitem(.requirement[.@choice]) ) + " "+ getitemname(.requirement[.@choice])+ "^000000."; close; } delitem .requirement[.@choice], (.cost[.@choice] * .@input ); // delete item requirements getitem .exchange[.@choice], .@input; // get item mes " ","Thanks for exchanging!"; close;OnInit: // Config setarray .exchange[1],7229, 7228, 7757; // exchange item. setarray .requirement[1],7232, 7231, 7233; // item requirement. setarray .cost[1], 5, 10, 15; // exchange cost. end;}