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

What is wrong with my dash/double tap script as it fires even with the wrong key...?

Asked by 5 years ago

Hope your having a fine day! I'm having a problem with my double tap script it would always print 22222 even if I take breaks over 1 second then tap W or Up, but worse it fires after every key ... Halp meh ;-;. Thanks in advance!!!.

ScriptingNub!

local Input = game:GetService("UserInputService")
local Character = game.Players.LocalPlayer.Character

 Input.InputBegan:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.W or key.KeyCode == Enum.KeyCode.Up then
        local timeing = tick()
        Input.InputBegan:Connect(function(key)
            local timez = tick() 
            local timing = (timeing - timez)
            if timing <= 1 then
                print(22222)
            elseif timing > 1 then 

            end
        end)

    end
end)
2
you didnt check if the player pressed W or Up in the 2nd InputBegan event theking48989987 2147 — 5y
0
WHY DO I DO THIS SO OFTEN... ScriptingNubs 55 — 5y

Answer this question