InputSequence Module — Track and Validate Key Sequences with Accuracy and Timing

InputSequence Module — Track and Validate Key Sequences with Accuracy and Timing

Hi fellow developers!

I’m excited to share a lightweight and flexible InputSequence module I developed for Roblox. It lets you define sequences of key presses that players need to perform, then tracks their progress, accuracy, timing, and failures.

Features:

  • Define custom sequences using Enum.KeyCode arrays
  • Optional time limits and maximum failure counts
  • Automatic progress tracking and accuracy calculation (returns formatted percentage)
  • Callbacks for matched sequences, failures, correct inputs, and incorrect inputs
  • Supports restarting/resetting sequences cleanly

How to use:

Simply create a new InputSequence with your desired key sequence and options, then subscribe to its events for game logic:

Localscript

local InputSequence = require(path.To.InputSequence)

local sequence = InputSequence.new({Enum.KeyCode.W, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.D}, 10, true, 3)

sequence:OnCorrectInput(function(key) 
    print("Pressed correct key:", key.Name) 
end)

sequence:OnIncorrectInput(function(key, fails, maxFails) 
    print("Wrong key:", key.Name, "Failures:", fails, "/", maxFails) 
end)

sequence:OnMatched(function(elapsed, fails, total) 
    print("Sequence completed! Time:", elapsed, "Failures:", fails) 
end)

sequence:OnFailed(function(elapsed, fails, total) 
    print("Sequence failed!") 
end)

Why use InputSequence?

It’s great for implementing quick-time events, cheat code sequences, or any gameplay mechanic that depends on precise player input timing.


Get InputSequence


Feel free to ask questions or suggest features! I’m open to feedback and improvements.

Thanks for checking it out!
— Fhilyp_br

3 Likes

The download link doesnt work : (

2 Likes

Hello @C4FF3INATI0N_D4Y,

The Input Sequence Asset seemed to be private, but it is now public! Thanks for letting me know!

1 Like

Thanks for this, gonna make a stratagem system for my game.

↑→↓↓↓

1 Like