Hey hey folks.
I’m having some issues getting a menu to open. I seem to have identified the problem, but I’m not sure why it’s doing what it’s doing.
I’m using gameProcessedEvent so that it doesn’t open when the user is typing, but now it won’t open at all. I have a first person mouse lock that uses the same thing, and it works just fine. What gives?
Here’s my code:
UserInputService = game:GetService("UserInputService")
ReplicatedStorage = game:GetService("ReplicatedStorage")
options = require(ReplicatedStorage.options)
keyPC = Enum.KeyCode.O
keyCons = Enum.KeyCode.ButtonY
UserInputService.InputBegan:Connect(function(key, gameProcessedEvent)
if gameProcessedEvent then return end -- removing this makes the code work fine, provided it opens when typing
if key.KeyCode == keyPC or key.KeyCode == keyCons then
options.ShowOptions() -- opens the options/settings menu
end
end)