how to write used item to rpg maker variable

how to write used item to rpg maker variable , I want that when I use an object several times, I get 1 image, and if a certain number of times, then another, how to make it count the number of times.
I have moved this thread from Product Discussion and Support to RPG Maker MV Support. I moved this based on your “primarily uses” but let me know if you’re using a different engine and I can move it again.
If you want to change a Variable by using an Item. Give the Item the command to use a Common Event.
In that Common Event you want to change the Variable X to Add +1.
that means whenever you use that item, your variable is going to increase to +1 (1, then 2, then 3, etc...)

Once you reach the point of wanting to display an image,
in the same Common Event you want to add an If statement, once your Variable is high enough, it should display your image you wanted to show the player.
If that image is an Item the player receives, then you'll have to change things up a little in that If statement. (this can be done multiple times If you set the count back to 0)
thanks you sou mutch , I do not know why, but I set the variable through the lifted items and the error came out because it counted the lifted items and not the used ones, I somehow did not realize to just put a variable at the top of the event, do what you want, but I did not think that it is so simple.
if it doesn't work, why not show your event? and item to it.

if you do it right, it does work, there are some methods, but for beginners,
this is most user friendly way to approach it.

if you want it more automatically, it probably require a plugin and a simple
notetag to do that in a variable once used.

but a lot of stuff can be done without plugins if you learn the engine a bit.
do the inbuilt tutorial, search some tutorial for switches, variables and common events.

you will be surprised how many things is possible with little knowledge =)
This plugin will store the last selected item in a variable

There's also this which gets the last action performed, with the item scene as an option

Original thread: https://forums.rpgmakerweb.com/threads/how-to-write-used-item-to-rpg-maker-variable.163583/