Every time I chat and click on the KeyCode for my script below, it triggered the "InputBegan" event. Is there a way to make the script "postpone" (in a sense) the event, so that the function connected to the "InputBegan" event doesn't run while chatting?
-- Local Script located in game.StarterGui
Player = game.Players.LocalPlayer
UIS = game:GetService("UserInputService")
UIS.InputBegan:connect(function (InputObject)
if InputObject.KeyCode == Enum.KeyCode.F then
print("F is pressed!")
end
end)
This is what happened when I was chatting. Notice the output.

2 comments
Thank you so much for this! Now I can completely ditch KeyDown events with confidence! xD
This helped and was simple. Thanks.