You could just do
"Attack key is down." -> Set attacking to 1
else -> attacking = 0
I know. But that's the catch. Usually, for attacking, you don't want to hold the attack key down.
You want to press it once, see the attack animation do its thing and set the value back once its done. So you need to time it.
What I've set-up is:
1) On "Attack" pressed
+ Is global variable 'Attacking' Equal to 0
-> Set Animation to Attacking
Play current animation
Start ignoring user input
System: Set gv 'Attacking to 1
Function: Call function "ReturnControl" after 400ms
Function "Call function "SetAttackBack" after 400ms
2) On Function "ReturnControl" -> Player: Stop ignoring user input
3) On Function "SetAttackBack" -> System: Set gv 'Attacking' to 0
So it'd be cool if I wouldn't need the function object in every layout just to set the values back.
Also, the cool thing when you time it is that you can either let the animation play all its frames or interrupt it beforehand, cause if the animation needs 800ms to complete, but you get your input back after 400ms, you can interrupt it and keep going - that's exactly what every Castlevania title is doing, for example.