You would have to implement a timer logic to this structure.
You could try something like this :
Code:
◆ Control Switches: #0208 Begin button meshing = ON
◆ Control Variables: #0235 Button Mesh Width = 0
◆ Control Variables: #0236 Timer = 0
◆ Loop
◆ Control Variables: #0236 Timer += 1
◆ If: Button [OK] is pressed
◆ Control Variables: #0235 Button Mesh Width += 2
◆ Show Picture: #3, BME-PressOK2, Upper Left (360,430), (100%,100%), 255, Normal
◆ Wait: 3 frames
◆ Control Variables: #0236 Timer += 3
◆ Show Picture: #3, BME-PressOK1, Upper Left (360,430), (100%,100%), 255, Normal
◆ End
◆ If: Button Mesh Width ≥ 100
◆ Control Switches: #0208 Begin button meshing = OFF
◆ Show Text: "Event Succes"
◆ Break Loop
◆ End
◆ If: Control Variables: #0236 Timer ≥ 600
◆ Control Switches: #0208 Begin button meshing = OFF
◆ Show Text: "Defeat Event"
◆ Break Loop
◆ End
◆ Wait: 1 frame
◆ Repeat Above
◆ If: Button Mesh Width ≤ 0
◆ Control Variables: #0235 Button Mesh Width = 0
◆ End
◆ If: Button Mesh Width ≥ 100
◆ Control Variables: #0235 Button Mesh Width = 100
◆ End
Did not test, but should do the job
You can change
◆ Show Text: "Defeat Event" by anything you want it to be for "Defeat", an event call, or anything else
You won't have to reset the timer, as every time this event starts the timer will be set to 0.
But think about resetting the
Button Mesh Width value.
If you are at ease with javascript and want a more accurate timing, you could use something like this :
JavaScript:
//Before the loop begins, set the current time
$gameVariables.setValue(237, Date.now())
// 237 would be the start of the timer
//Before checking for the Mesh value and Timer value, set the elapsed time
$gameVariables.setValue(236, (Date.now() - $gameVariables.value(237)) / 1000)
// 236 would be the elapsed time based on the start timer
Then, instead of checking for a value of 600 (600 frames = roughly 10 seconds) you can check for a value of 10 or more (current time - start time, which will be a float)