Why won't this local script deactivate or cancel out if player is typing?

I used “IsTyping” and typed a condition (if IsTyping then return end) when activating this local script BUT player still able to activate it when typing in chat,the condition did not stop the script from working.

What I want it to do:
I want this local script to not activate when player is typing.

Help will be appreciated.
If want any more info just ask,I try to be quick as possible and reply
or just dm me on discord.

Those parameters don’t exist?

Its just input and gameproccessedevent

I don’t know why you need p5 and p6 but your last two parameters will always be nil

Edit: Also I know you didn’t ask but for the code above you could just make it a lot simplier by using RemoteFunctions instead of sending and returning with a remote event

RemoteFunction.OnClientInvoke = function()
  return LocalPlayer:GetMouse().Target