I am wondering how you can change the chat visibility or can you? I got a basic script in a screenGui. Here it is,

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.KeyDown:connect(function(key)
	if key == "q" then
		script.Parent.Parent.Parent.Chat.Visible = false
	else
		script.Parent.Parent.Parent.Chat.Visible = true
	end
end)