Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a line for double pressing for userinputservice?

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 comment

1

You would need to store the timeings, then compare them.

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.