would i have to use userinputservice two times, or is debounces needed?
this is not a request
Using UserInputService
and Tick
, I came up with this script. Change waitTime to the amount of time they have to press the button again.
local player=game.Players.LocalPlayer local pressed=tick() local waitTime=.3 local uis=game:GetService("UserInputService") uis.InputBegan:connect(function(key) if key.KeyCode==Enum.KeyCode.W then if tick()-pressed<waitTime then print("Pressed W twice") else print("Pressed W once") end pressed=tick() end end)