#Why debounce isnt working?

3 messages · Page 1 of 1 (latest)

simple blaze
#
    if input.UserInputType == Enum.UserInputType.MouseButton2 then
        if m2db == false then
            m2db = true
            StartTime = os.clock() - Clock
            task.wait(0.6)
            m2db = false
        end
    end
end)

uis.InputEnded:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton2 then
        local EndTime = os.clock() - Clock
        local Damage = math.clamp(EndTime / 0.6, 0, 1)

        if humanoid:GetState() == Enum.HumanoidStateType.Freefall then
            m2K = Enum.KeyCode.S
            print("freefall")
        end

        game.ReplicatedStorage.Combat:FireServer("m2", m2K, Damage)

        task.wait(0.6)
        m2db = false
    end
end)
south gale
#

You forgot to actually check if the debounce is active