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

How to stop other keys from cancelling event from another key?

Asked by 4 years ago
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(inst)
        if inst.KeyCode == Enum.KeyCode.Q then
        if workspace.grapplecheck.check.Value == true then
                    mouseDown = true
        end
    else
        mouseDown = false
    end
end)

I am making a game where players can grapple with the Q key (I can't use mouse cause those are Fire and Grab) It works normally when I hold down Q but when I press another key, it cancels out the rope.

Answer this question