I want to make a double tap W to dash script in my game but i dont know how to could someone give me an idea of what i would need to do to make it work and i can figure out the rest from there?
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.
local DoubleDebounce = false local UserInputService = game:GetService('UserInputService') local TargetKeyCode = Enum.KeyCode.W UserInputService.InputBegan:Connect(function(input,gameEvent) if not gameEvent and input.KeyCode == TargetKeyCode then if not DoubleDebounce then DoubleDebounce = true spawn(function() wait(1) --Interval of time where the player can double tap a key DoubleDebounce = false end) elseif DoubleDebounce then print('Dashing') --Perform a dashing action DoubleDebounce = false end end end)