Button Press Changes Graphic

For my game, I want to have a feature where pressing a button will cause the character to be invisible. It will be used to get specific items and avoid attracting enemies. Is there a script necessary that’ll change the player’s graphic when the button is pressed. Can all the sprites in the map immediately approach the player when they aren’t pressing said button? I already tried Conditional Branches, but it doesn’t work. So I’m at loss at what do. How do I start?
Based on your description, this does seem doable with events alone. It would've helped to show us what you've tried thus far; if only to give us more insight as to what you're trying to accomplish.

You could run a parallel process via common event which checks if a button is being pressed.
This can work as a toggle, or the button being held down based on the approach.
I've chosen the latter for the example below.
Spoiler: Example
invisible_00.PNG
You can then setup your map events to check for the Is Invisible switch...
Based on your description, this does seem doable with events alone. It would've helped to show us what you've tried thus far; if only to give us more insight as to what you're trying to accomplish.

You could run a parallel process via common event which checks if a button is being pressed.
This can work as a toggle, or the button being held down based on the approach.
I've chosen the latter for the example below.
Spoiler: Example
You can then setup your map events to check for the Is Invisible switch...

Well, to be honest, I did something similar to that, but forgot not to put exceptions for the Conditional Branches. Anyway, this is really helpful and convenient, thanks a lot! It will help me progress a lot with my game. Thank you very much!

But my problem now is....how do I make the enemies approach the player if they're not pressing the Y button? I was using this stealth tutorial before, but it's still usable now that the player is invisible?
The answer is more or less in the question. Again, I don't know how your enemy events are setup, but the solution should be obvious from here on. It should be as simple as adding a conditional branch where you need it.

Conditional Branch: Switch[Is Invisible] == OFF
Approach Player.
Branch End
The answer is more or less in the question. Again, I don't know how your enemy events are setup, but the solution should be obvious from here on. It should be as simple as adding a conditional branch where you need it.

Conditional Branch: Switch[Is Invisible] == OFF
Approach Player.
Branch End

Yeah, I did figure it out by myself in the end. But thanks for making things clear. You've helped me a lot!
This thread helped me a lot, but I wanted to make a similar system except that it includes a gauge. This system works fine, but the problem is.....how can I make the player turn visible again after the bar goes down to 0??

stealth.JPG
Please do not use someone else's thread to ask a different question. Things can get very confused if there are multiple queries from more than one person in the same thread.

I suggest you start a new thread, perhaps giving a link back to this one so that people can see what the background is.

Original thread: https://forums.rpgmakerweb.com/threads/button-press-changes-graphic.79435/