I have a game where the "P" key has a special function. I use InputBegan to check, but it seems to fire when the user types "p" in chat as well. How can I filter out keys typed in the chat box?
Full code (LocalScript in StarterPack):
player = game.Players.LocalPlayer
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.P then
game.Workspace.remoteEvents.pKey:FireServer(player)
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
