I am making a building game, and I want the player to press E to open the inventory, and while the player is placing a structure, he/she could press Q to cancel the placement.
But, whenever I test the game, none of those keyboard shortcuts work. (Also, I noticed if I have just one keyboard shortcut, (lets say its E), it would work. But how come two keyboard shortcuts in the game don't work?
How would I fix it?
Here is the LocalScript below:
-- When player presses E, show the inventory
game.ContextActionService:BindAction("keyPress", function (actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
if (InventoryShown == false) then
-- My code to hide the inventory
return true
end
if (InventoryShown == true) then
-- My code to show the inventory
return true
end
else
return false
end
end, false, Enum.KeyCode.E)
-- When player presses Q, quit the placement
game.ContextActionService:BindAction("keyPress", function (actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
if (Placing == true) then
-- My code to quit placing is here
end
else
return false
end
end, false, Enum.KeyCode.Q)

2 comments
Where's the wording to point towards E at the start?
Nevermind, found it.