MZ Button Picture problem

Hello everybody, i have a problem with the base plugin "Button Picture" of RPGMaker MZ
i've setup some clickable pictures and it's works perfectly, but there is a problem "when" i click multiple times on the pictures, the common event that call the plugin is repeated as many times as clicks i've done and this create various graphic problems/glitch, i've tried to use "wait" command but don't change nothing, how i can do to fix it?

Thanks and sorry for my bad english.
I think what you could do is in the common event show the same picture on the same spot with a different picture id and then erase the clickable picture. Then if you need to return the picture to be clickable again, you set a new clickable picture on the spot.

Edit: Or just change the common event tied to the picture to an empty common event?
it depends on what the common event does.

for example one solution is to setup a flag on the first click that makes all further clicks do nothing until a timer runs out and resets the flag.

but there are other solutions depending on what the button is supposed to do.
in a nutshell, i'm doing a visual/date simulator game, now we have a world map with 7-8 structures that are clickables, now if i click on home structure, an house interior will show instead of worldmap (erase the old pictures and put the new ones,etc) but if clicks multiple times on the house, the transiction effect (teleport character) also repeats too :/
Disregard. Pressed enter too soon.

EDIT: I use that plugin a lot and it is very important for my Sudoku game. Depending on what you are trying to do and how often the picture needs to be clickable will depend on what might work best.

Generally, I tend to use Switches and Conditional Branches to determine if the picture can be clicked at any given time.

If you describe exactly what you are trying to achieve, the suggestions might be more helpful to your specific case.
You can try to add in a conditional check to make it so that subsequent clicks of the button don't execute any commands unless the first click has finished processing. Whether or not it'll work kinda depends on how the plugin works, which isn't something I'm able to check right now. Here is a pseudocode example that can be translated to event commands:

Code:
if buttonClicked is OFF
{
  switch buttonClicked ON
  // Do whatever stuff the button is supposed to do
  switch buttonClicked OFF
}

In the above example, buttonClicked is a switch.
Thanks for the answers guys, i've find a big problem about this plugin, it ignores every conditional branches on it, i've tried to put an additional IF but don't seems to change something. :/
I would guess what is happening is that it queues the common events, and then when starting the next ones all your switches/conditions are again set in a way that it runs the code.

But was there something wrong with my suggestions in the first reply of this thread? The easier one is just to assign an empty common event to the picture with the plugin command at the start of your picture common event and then assign it back at the end.
Then it sounds like you might be doing something wrong or I am just not understanding what you are experiencing.

If you post screenshots of your Events, someone might be able to help you.

For instance, here is an excerpt of a Parallel Event that is running. As you can see, the ButtonPicture Plugin here is only active under a specific condition, when a particular Switch is on. This particular Parallel Event has 81 of these sections that check 81 squares of my Sudoku puzzle. In another part of the Event, other buttons are active all the time with no Conditions.

ButtonPicture Excerpt.png
If I understood correctly what happened is that he tried to use a switch at the beginning to make the code run only if the switch is manipulated again at the end. But since it queues the common event, the code only starts again when the previous one has already gone to the end.

Anyway, ZombieKid's pic shows a version of what I suggested at the start. You break the picture bind by erasing and replacing the old pic (well, in Zombiekid's example he doesn't first use erase command, but just straight uses the show picture command to replace the pic with the same id). You don't have to do that with a parallel event though. You can do it in your picture common event.
Illustration.png

This is the screenshot of the 2 events, as you can see there are an IF that will be off when clicked (worldmap.switch) but don't seems to works
I've tested in worldmap if that switch works naturally and switching worldmap.switch off allows me to click on it (the house structure) anyway
Maybe I solved it by deleting the picture (n°2) before the event was called but it's strange because this plugin seem to exceed the rules of the software itself
If you have a picture Id 1 with common event attached, doesn't it work if the common event is just:

Show picture Id 1 (at the same coordinates) // this will erase the picture bind, so you can't click it
*YOUR STUFF*
Plugin command attach common event to picture 1 // now it can be clicked again
as you can see there are an IF that will be off when clicked
there is no if anywhere in either event screenshot.

there is a page condition, but no conditional branch - those work differently and I was talking about using a conditional branch inside your common event.

additionally, why did you crop off half of the map event screenshot?
to tell you what a page condition does we need the entire screen, including page numbers and trigger conditions - sorting page conditions without knowing how many pages are there is difficult.
and as mentioned above page conditions are not exactly the same as conditional branches...

Original thread: https://forums.rpgmakerweb.com/threads/button-picture-problem.165977/