How do I make a "on button held" function?

I want an on button held function. Something like, when the left button is held and A button is pressed while the Left button is held, it does something like play an animation. I’m trying to make a fighting game similar to Super Smash Bros, and I would like to make an animation play when left or right is pressed and also the A button is pressed.

Thanks.

2 Likes

Welcome @Haybaleson
First go to extensions.
Here.
Then you should use the button combos extension.
button-combos
This extension can do what you need.

2 Likes

But how exactly would I do on press and held with this extenstion?

1 Like

I don’t think you need that extension. This should do:

It’s basically: when you press a, check if left is being pressed.

This extension doesn’t really do that. If you want to know if a button has been held for a certain amount of time, you could use a variable like “AHoldTime” that is increased by one in a forever loop if the <is [A] button pressed> Boolean is true, and is set to 0 if it’s not.
Then when the player pressed the other button in the combo, you could check that this variable is above a certain number and activate the ability if it is.

If you just want to check if two buttons are being pressed at the same time, without the timer, you can use two of those <on button pressed> booleans to check both buttons at once, or just check the other button when one button is pressed.