Erinoxy Posted March 2, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 3 Joined: 01/24/17 Last Seen: March 6, 2017 Share Posted March 2, 2017 Hi all, I would like to know how I can add a NPC that will only check the cards in my inventory and will display that in a select list. I already had a look on the custom scripts but I didn't find anything convincing. Many thanks in advance. Quote Link to comment Share on other sites More sharing options...
0 Erinoxy Posted March 5, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 3 Joined: 01/24/17 Last Seen: March 6, 2017 Author Share Posted March 5, 2017 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. 2 Quote Link to comment Share on other sites More sharing options...
Question
Erinoxy
Hi all,
I would like to know how I can add a NPC that will only check the cards in my inventory and will display that in a select list.
I already had a look on the custom scripts but I didn't find anything convincing.
Many thanks in advance.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.