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

Uesrinput printing twice even tought there is a debounce?

Asked by
hokyboy 270 Moderation Voter
3 years ago

My print printes twice even tough there is a debounce it should only fire once else my script will kinda glitch

local Debounce = false

uis.InputBegan:Connect(function(input)
    if Debounce == false then
    if input.KeyCode == Enum.KeyCode.Space then
        Debounce = true
        print("Space bar pressed")
        local Screens = 1

        if Screens == 1 then
            script.Parent.Warn1.Visible = false
            script.Parent.Warn2.Visible = true
            Screens = 2
            warn(Screens)
            MakeUIAlive2()

        elseif Screens == 2 then
            script.Parent.Warn2.Visible = false
            script.Parent.HeadphonesNotice.Visible = true
            Screens = 3
            warn(Screens)
            MakeUIAlive3()

        elseif Screens == 3 then
            print("Ok?")
        end
        end
    end
end)
0
Only printed once for me, could try changing the name of the script to make sure its coming from the exact same one or maybe roblox studio is being weird enzotinman1 23 — 3y

Answer this question