Help With button mash

i'm currently making a Game where at one point you have to press a button a number off times to open a door but i can't get it to work how i want i would like that you have to press and release a button multiple times, but instead it just works if you hold down the button.
is there anyway i can fix it? ( i attached the Event Page)

Screenshot 2022-08-19 002427.png
You'll need to check if a button is triggered, rather than pressed, to see if it was released and then hit again. Little bit confusing terminology there.
You can use a (self) switch to track whether the button was pressed or not last frame. Here's an example I copied from one of my scrap projects:
Spoiler
◆Control Variables:#0019 Mash = 30 ◆Control Variables:#0020 Time = 300 ◆Loop ◆If:Button [OK] is pressed down ◆Wait:1 frame ◆ :Else ◆Break Loop ◆ :End ◆ :Repeat Above ◆Loop ◆If:Button [OK] is pressed down ◆Control Switches:#0020 ButtonDown = ON ◆ :Else ◆If:ButtonDown is ON ◆Control Switches:#0020 ButtonDown = OFF ◆Control Variables:#0019 Mash -= 1 ◆ :End ◆ :End ◆If:Mash ≤ 0 ◆Comment:Complete! ◆Break Loop ◆ :Else ◆If:Time ≤ 0 ◆Comment:Time up! ◆Break Loop ◆ :Else ◆Comment:Continue. ◆Control Variables:#0020 Time -= 1 ◆Wait:1 frame ◆ :End ◆ :End ◆ :Repeat Above
The first loop is to make sure the button is unpressed before starting, the second one is for the actual mashing.

Alternatively, as implied, you could use Conditional Branch -> Script:

Input.isTriggered("ok")
This should be true if the "ok" button is pressed this frame but wasn't pressed the previous frame.

Also, in case you haven't seen it, this tutorial may be helpful:
You can use a (self) switch to track whether the button was pressed or not last frame. Here's an example I copied from one of my scrap projects:
Spoiler
◆Control Variables:#0019 Mash = 30 ◆Control Variables:#0020 Time = 300 ◆Loop ◆If:Button [OK] is pressed down ◆Wait:1 frame ◆ :Else ◆Break Loop ◆ :End ◆ :Repeat Above ◆Loop ◆If:Button [OK] is pressed down ◆Control Switches:#0020 ButtonDown = ON ◆ :Else ◆If:ButtonDown is ON ◆Control Switches:#0020 ButtonDown = OFF ◆Control Variables:#0019 Mash -= 1 ◆ :End ◆ :End ◆If:Mash ≤ 0 ◆Comment:Complete! ◆Break Loop ◆ :Else ◆If:Time ≤ 0 ◆Comment:Time up! ◆Break Loop ◆ :Else ◆Comment:Continue. ◆Control Variables:#0020 Time -= 1 ◆Wait:1 frame ◆ :End ◆ :End ◆ :Repeat Above
The first loop is to make sure the button is unpressed before starting, the second one is for the actual mashing.

Alternatively, as implied, you could use Conditional Branch -> Script:

Input.isTriggered("ok")

This should be true if the "ok" button is pressed this frame but wasn't pressed the previous frame.

Also, in case you haven't seen it, this tutorial may be helpful:
thanks this helped alot ^^

Original thread: https://forums.rpgmakerweb.com/threads/help-with-button-mash.150592/