return function(P)local N=P.Color local X=service.PlayerGui local d=service.Players.LocalPlayer local C=d:GetMouse()local r=script.Parent.Parent if N=="\111\102\102"then local P=client.UI.Get("\066\067\104\097\116")if P then for P,N in pairs(P)do if N~=r then N:Destroy()end end r:Destroy()end else if X:FindFirstChild(r.Name)then X[r.Name]:Destroy()end local P=r.Frame.Box local a=r.Frame.Close P.Text="\067\108\105\099\107 \104\101\114\101 \111\114 \112\114\101\115\115 \"\059\" \116\111 \099\104\097\116"P.FocusLost:connect(function(X)if X and(d.Character:FindFirstChild("\072\101\097\100")and(N and P.Text~="\067\108\105\099\107 \104\101\114\101 \111\114 \112\114\101\115\115 \"\059\" \116\111 \099\104\097\116"))then service.ChatService:Chat(d.Character.Head,service.LaxFilter(P.Text),N)P.Text="\067\108\105\099\107 \104\101\114\101 \111\114 \112\114\101\115\115 \"\059\" \116\111 \099\104\097\116"end end)C.KeyDown:connect(function(N)if N=="\059"then P:CaptureFocus()end end)a.MouseButton1Click:connect(function()r:Destroy()end)gTable:Ready()end end
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name

return function(data)
	local color = data.Color
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local mouse = localplayer:GetMouse()
	local gui = script.Parent.Parent

	if color == "off" then
		local guis = client.UI.Get("BChat")
		if guis then
			for i, v in pairs(guis) do
				if v ~= gui then
					v:Destroy()
				end
			end
			gui:Destroy()
		end
	else
		if playergui:FindFirstChild(gui.Name) then
			playergui[gui.Name]:Destroy()
		end

		local box = gui.Frame.Box
		local close = gui.Frame.Close

		box.Text = 'Click here or press ";" to chat'

		box.FocusLost:connect(function(enterPressed)
			if
				enterPressed
				and localplayer.Character:FindFirstChild("Head")
				and color
				and box.Text ~= 'Click here or press ";" to chat'
			then
				service.ChatService:Chat(localplayer.Character.Head, service.LaxFilter(box.Text), color)
				box.Text = 'Click here or press ";" to chat'
			end
		end)

		mouse.KeyDown:connect(function(key)
			if key == ";" then
				box:CaptureFocus()
			end
		end)

		close.MouseButton1Click:connect(function()
			gui:Destroy()
		end)

		gTable:Ready()
	end
end
