Help with making an ability activate when press key combination

Hello, I want to know how to make a script where if a player presses a button to do an ability, they can do a key combination to activate the remote event for the ability. If they change their mind and dont want to activate the ability midway through the key combination, they can just press the button again.(by button, I mean a key on the keyboard). I’m trying to make a system where to activate abilities you have to first have the ability ready the do the specific key combination for that ability. Each ability I will costomize the ability. I’ll give you an example in steps the player has to take

  1. The move they want to do is called fireball
  2. They press the key to do fireball and they do an animation signituring that they are getting ready to do an ability
  3. They do a key combination for the fireball and each key they press for the combination, they do an animation.
  4. When they get the combination correct then they release the fireball dealing damage to their opponent

SECOND SENARIO

  1. The player does the same thing and they press the key for the fireball doing the animation signaturing they are getting ready to do an ability
  2. They change their mind and dont want to do the ability anymore and press the key again to get rid of the animation.

(Keys I will most likely be using)

  1. R
  2. Whatever the key is next to R

DIFFERENT COMBINATIONS I WOULD LIKE TO INCLUDE

  1. R,T,T,R
  2. R,T,R,T

I don’t think anyone really will do the code for you, neither will I but I can push you in the direction of getting it done, what you could do but I think there are better ways is to keep track of the keycodes activated through userinputservice after the first one in the combination was pressed. The other way to do this is using contextactionservice. Both have plenty tutorials. After keeping track of them, compare them to the example and if they match run the code you want.

1 Like