So, you want a NORMAL npc to sell the item and restock it. But you want it done via Menu options and text.
prontera,150,180,4 script Stock_NPC 123,{switch( select( "Buy:Sell" ) ) { case 1: if( !$amount ){ mes "Sorry out of stock."; close; } mes "Currently Selling: "+ getitemname($itemid) +""; mes "Amount in stock: "+ $amount +""; mes "Price per: "+ $price +""; mes "How much would you like to buy?"; input .@purchase,1,$amount; if ( zeny < ( .@purchase * $price ) ){ mes "Not enough funds."; close;} zeny-= ( .@purchase * $price ); getitem $itemid,.@purchase; $amount -= .@purchase; next; mes "Transaction Complete."; close; case 2: mes "Currently Selling: "+ getitemname($itemid) +""; mes "Amount in stock: "+ $amount +""; mes "Sell back price: "+ ($price/2) +""; mes "How much would you like to buy?"; input .@sell,1,10000; if( countitem($itemid) < .@sell ){ .@sell = countitem($itemid); } zeny += ( .@sell * ($price/2) ); delitem $itemid,.@sell; $amount += .@sell; next; mes "Transaction Complete."; close;}OnInitOnce:$itemid = 501; //Red Potion.$start_amount = 30000; // Amount available to start with.$price = 100; //Price per item.end;}
OR
Do you want it to work like an actual shop where you can buy the item, and it only restocks when that same item is sold back? (This can be emulated using a dynamic shop npc, bit more difficult but still very easy).