How would I detect if a player is holding a button for too long

I need to know this. I don’t see any blocks/commands that could help me out with this.

Maybe you could try something like this.

So what it does, is when the A button is pressed, then the current game time (in ms) is saved in a variable. In a forever loop, if checks if the A button is pressed and if it has been more than 2000ms since the button was first pressed.