Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is there a line for double pressing for userinputservice?

Asked by 8 years ago

So like let's say I have an animation that backflips the player backward, but I only want it to happen when the player press the key "S" twice, is there a way for this? sorry if it seems like I am asking for a script, but I don't know the specific line for this.

1
You would need to store the timeings, then compare them. User#5423 17 — 8y

1 answer

Log in to vote
4
Answered by 8 years ago

There is no specific line for this.

What you can do to make this work though is store the timing between the first 'S' tap with tick() and store the second 'S' tap the same way, and get the difference. If x time or lower is the only way to activate your script, just set up a conditional that fires when the difference is x or lower.

Hope this helped out.

Ad

Answer this question