Hi everyone. Does anyone know how to do this? Basically what I need is a script that can check the item equipment of a player which is not equip and remove it all from the players inventory.
example:
A player has a 3 Silk Robe (ID:2321) and 5 Shoes (ID:2403) in his inventory. When the player clicks this NPC, all of his 3 Silk Robe and 5 Shoes in his inventory will be removed and he will get an item in exchange like Red Potion.
I am tying to use this one but I cant seem to make it work. It can only remove an item one at a time which is not what I want.
if( countitem(2321) == 1 ){
getinventorylist;
for (set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
if ( @inventorylist_id[.@i] == 2321 )
set .count01, @inventorylist_amount[.@i];
delitem 2321, .count01;
getitem 501,.count01;
}
if( countitem(2403) == 1 ){
getinventorylist;
for (set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
if ( @inventorylist_id[.@i] == 2403 )
set .count01, @inventorylist_amount[.@i];
delitem 2403, .count01;
getitem 501,.count01;
}
Question
Reborn
Hi everyone. Does anyone know how to do this? Basically what I need is a script that can check the item equipment of a player which is not equip and remove it all from the players inventory.
example:
A player has a 3 Silk Robe (ID:2321) and 5 Shoes (ID:2403) in his inventory. When the player clicks this NPC, all of his 3 Silk Robe and 5 Shoes in his inventory will be removed and he will get an item in exchange like Red Potion.
I am tying to use this one but I cant seem to make it work. It can only remove an item one at a time which is not what I want.
if( countitem(2321) == 1 ){ getinventorylist; for (set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 ) if ( @inventorylist_id[.@i] == 2321 ) set .count01, @inventorylist_amount[.@i]; delitem 2321, .count01; getitem 501,.count01; } if( countitem(2403) == 1 ){ getinventorylist; for (set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 ) if ( @inventorylist_id[.@i] == 2403 ) set .count01, @inventorylist_amount[.@i]; delitem 2403, .count01; getitem 501,.count01; }
I hope someone can help me with this one...
Link to comment
Share on other sites
2 answers 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.