Hi, I tried to make a script which prints something everytime you double tap a key within 2 seconds, if the player does not double tap within 2 seconds, I want to print "too slow" . I used UserInputService to detect the key press, and I am using a localscript. Here is my code
local uis = game:GetService("UserInputService")
local count = 0
uis.InputBegan:connect(function(input, gp)
if input.KeyCode == Enum.KeyCode.F and not gp then
count = count + 1
local started = tick()
if count <= 2 then
local difference = (tick() - started)
if difference <= 2 then
print("you pressed in 2 seconds congrats")
else
count = 0
print("too slow")
end
end
end
end)
thank you -onepunchactivated

2 comments
Where is the script located?
I swear to to my life I will find the answer I'm a maniac