Jump to content

Erinoxy

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

Community Answers

  1. Erinoxy's post in NPC - card buyer was marked as the answer   
    Finally found a solution by looking in another existing script..
    First step : get the inventory and loop on it. In my case I only took the elements having the number 6 (card). We add the ID of the card inside the array and we also create the menu by adding the name of the card.
    getinventorylist; for (; .@i < @inventorylist_count; .@i++) { if(getiteminfo(@inventorylist_id[.@i],2) == 6){ .@items[.@count] = @inventorylist_id[.@i]; .@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]) + ":"; .@count++; } } Get the selected element : 
    .@select = select(.@menu$) - 1;  
    Delete the selected item and give money : 
    delitem .@items[.@select],1; set Zeny, Zeny + 500000;  
    I hope it will be useful for seomeone else.
     
×
×
  • Create New...