Switch When Player Removes Equipment

Hello again lovely people, have I hit my quota yet for forum questions? 🙂

I was wondering if this engine allows for me to make a switch when the player removes an item.. Basically if the player is wearing "Guards Equipment" on his chest....the guards won't attack. I want to make it so that if the player removes the equipment while on the same map as the guards, a switch gets triggered and they become aggro.

Possible?
you'll need a script to trigger switched upon equipping or unequipping something.


Tsukihime wrote a script that runs common events upon equipping something, you can use that common event to check what armor is equipped and change the switch accordingly.


Giving events different behaviours based on switches is easy, just make one event page for the peacefull guard and one for the attacking guard, and condition the attacking page to the switch.
Appreciated!
Tsukihime has a Equip Events script, which lets you set a common event to run when either equipping OR un-equipping weapons/armor. You can put the switch toggles in there.

Edit: Derp andar ninja'd me by 10 minutes.
Thank you guys - I will definitely do that moving forward. Since I was impatient, I just created regular items and trigger switches for them. But Tsuk's script is far superior and more functional, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/switch-when-player-removes-equipment.23761/