How do I make a keypress listener? [Solved]
Asked by
6 years ago Edited 6 years ago
I am having a bit of difficulty with checking for keypresses, I have some code that is supposed to check for a keypress every tick, but I am not sure how to check for the actual keypress:
01 | function onKeyPress(actionName, userInputState, inputObject) |
02 | print ( "R has been pressed" ) |
05 | game.ContextActionService:BindAction( "keyPress" ,onKeyPress, false , Enum.KeyCode.R) |
07 | runService.RenderStepped:connect( function () |
08 | if [ not sure what to do here ] then |
Also a mini question here, is there any way to program everything instead of using small scripts everywhere?