Could I create a "GetInput" function and return the inputs using UserInputService?

Hey developers.

I have been working on a small project recently and I was wondering if there was any ways I could use UserInputService to create a function into a ModuleScript that would return me the inputs and that I could then compare them in another script to create an efficient system to detect inputs and create an easy-to-manage combat system.

I tried by myself but I couldn’t find a proper work-around, help needed! If you have another suggestion instead of what I am trying to figure out that could compensate, I’ll take!

1 Like

I’m pretty sure UserInputService:GetKeysPressed() can be used to get the inputs that are currently held down. UserInputService:GetKeysPressed

1 Like

I’m guessing you could use a table and module approach like so:

But this might not be what you are looking for as you might want to add other features special to your system which needs a different method of organization such as combos.

hopefully it’ll give a hint of what you can do to organize stuff.

Thank you! That’s exactly what I needed, guess I’ll take a better look to the API from now on.

1 Like

I’m definitively gonna go check this too, thank you too!