Conditional Branch: If Button [OK] is pressed down not working in battle?

New guy here, couldn't find an answer to this one..

I saw a script for a button mash- type of minigame, and wanted to implement that in battle as a beam struggle.
This is done as a common Event. Works perfectly as I'd hope on map, but in battle the check for button being pressed doesn't seem to work. The variable just drops down to zero and that's the end of that, no matter how much I mash the button.
Can anyone tell me if I'm missing something or if it's just plain and simple impossible to have a button mashing done this way in a battle?

Here's the Event I'm using:
struggleevent.png

Thank you very much in advance
First off, let me welcome you aboard.
Some terminology so that people can understand things easier.
A script is a piece of code in Ruby for RPG Maker VX Ace.
A plugin is code in javascript for RPG Maker MV.
A script in javascript is usually a 12 max lines of code script in Javascript that does something specific along with Eventing.
Eventing, is EXACTLY what you do using RPG Maker here.

So, one question, does it work if you call if on a map?
Is the problem occurring only in Battle?


Meanwhile check if @Kuro DCupu 's post helps you out

Hi!

Thank you! Yeah the event worked on map, the problem was in battles.

I actually figured this one out after way too long a time. Self switches don't work in battle, so the condition for adding to the variable was never met. Changed that one to a new switch and boom! Visually represented button mashing game for battles done!

This stuff is way too much fun to learn!
Ohhh! Self switches!
Self Switches belong to a specific MAP event. "Self" refers to that very event. You should use regular switches that can be seen everywhere. Self Switches "live" only inside a specific map event. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-if-button-ok-is-pressed-down-not-working-in-battle.121411/