Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a double tapped key script?

Asked by 10 years ago

I know how to make a regular if key == "" then script but how do you make it so that you have to press the key twice

1 answer

Log in to vote
-2
Answered by 10 years ago
local timeBeforePressingSecond=5

game.Players.LocalPlayer:GetMouse''.KeyDown:connect(function(k)
    local time=os.time''
    game.Players.LocalPlayer:GetMouse''.KeyDown:connect(function(k)
        if((time-os.time'')>=timeBeforePressingSecond)then
            --code
        end
    end)
end)
0
Thanks for writing the code for him so he learns nothing... He needs to write his script first then we help him. EzraNehemiah_TF2 3552 — 10y
Ad

Answer this question