Answered by
6 years ago Edited 6 years ago
I would do something like that. I don't know if 'DoubleDebounce' is the appropriated term in this kind of context, but yeah. I didn't also do, but you may add a Debounce that way the player can't spam this move.
01 | local DoubleDebounce = false |
02 | local UserInputService = game:GetService( 'UserInputService' ) |
03 | local TargetKeyCode = Enum.KeyCode.W |
05 | UserInputService.InputBegan:Connect( function (input,gameEvent) |
06 | if not gameEvent and input.KeyCode = = TargetKeyCode then |
07 | if not DoubleDebounce then |
11 | DoubleDebounce = false |
13 | elseif DoubleDebounce then |
15 | DoubleDebounce = false |