How to make npc seller response to player's bought item?

I know npc can response to items available in player's inventory using "if items...", but now I have some seller npc and there are some special items in their shops, so I want them to comment on those items whenever the player buy them
Eg:
Player buy special item from store A => npc A: "Please make good use of that"
Player buy normal items or don't buy anything => npc no response
Player has special item from other stores => npc no response

Is there any way to achieve this? Thank you in advance
Could set a variable equal to the number of that item in the player's inventory before the shop command, then after the shop command, have a conditional that checks if the number of that item in the player's inventory is greater than the variable set. If so, it means they purchased at least one.
Could set a variable equal to the number of that item in the player's inventory before the shop command, then after the shop command, have a conditional that checks if the number of that item in the player's inventory is greater than the variable set. If so, it means they purchased at least one.
It works!!! Thank you so much, I didn't realize "set variable" could do something like that 😀

In case somebody need the code

1625144906856.png

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-npc-seller-response-to-players-bought-item.137972/