Recently I've been motivated to do some scripting and one question that has been lingering in my head for years is how I would make it so that you would have to press a key within a certain amount of time or a value would go back to say 0.
An example would be
Combo is a number value
Combo == 0
Player presses E key
Combo now == 1
Player doesn't press the E key or a different key within the time limit of 2 seconds
Combo is now == 0
But if the Player presses the E key again the time limit resets and Player now has another 2 seconds
Combo is now == 2

4 comments
i think u just answered ur own question
But how would i actually code that?
Use a function to see if a numb value has changed, the moment it has, wait however long. Store the numb value as a variable. At the end of the time, compare the new numb value and the stored. If the same, set numb value to 0, else add one
Alrighty