✓ Accepted answer
Button1Pressed = false
Button2Pressed = false
Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.KeyDown:connect(function(Key)
if Key == "g" then
Button1Pressed = true
elseif Key == "h" then
Button2Pressed = true
end
print(Button1Pressed,Button2Pressed)
end)
Mouse.KeyUp:connect(function(Key)
if Key == "g" then
Button1Pressed = false
elseif Key == "h" then
Button2Pressed = false
end
print(Button1Pressed,Button2Pressed)
end)
This code sets it up where if two keys are pressed then both booleans return true. You can simply make a conditional to check for them.
1 comment
You could create two global booleans that would become true once someone hit the buttons. Then have a conditional statement that checks to see if both those booleans are true