client,service=nil,nil return function(O,g)if g then setfenv(1,g)end local Y local M=O.Color if M=="\111\102\102"then client.UI.Remove("\066\117\098\098\108\101\067\104\097\116")else local O=client.UI.Make("\087\105\110\100\111\119",{Name="\066\117\098\098\108\101\067\104\097\116",Title="\066\117\098\098\108\101 \067\104\097\116",Icon=client.MatIcons.Chat;Size={260,57},Position=UDim2.new(0,10,1,-80),AllowMultiple=false})if O then local g=O:Add("\084\101\120\116\066\111\120",{Text="\067\108\105\099\107 \104\101\114\101 \111\114 \112\114\101\115\115 \"\059\" \116\111 \099\104\097\116",PlaceholderText="\067\108\105\099\107 \104\101\114\101 \111\114 \112\114\101\115\115 \"\059\" \116\111 \099\104\097\116";BackgroundTransparency=1;TextScaled=true,TextSize=20})g.FocusLost:Connect(function(O)if O and(service.Player.Character:FindFirstChild("\072\101\097\100")and(M and g.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 if#g.Text>0 then service.ChatService:Chat(service.Player.Character.Head,service.LaxFilter(g.Text),M)end g.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)O:BindEvent(service.UserInputService.InputBegan,function(O,Y)if not Y and(O.UserInputType==Enum.UserInputType.Keyboard and O.KeyCode==Enum.KeyCode.Semicolon)then service.RunService.RenderStepped:Wait()g:CaptureFocus()end end)Y=O.gTable O:Ready()end end end
client, service = nil, nil

return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	local gTable
	local color = data.Color
	
	if color == "off" then
		client.UI.Remove("BubbleChat")
	else
		local window = client.UI.Make("Window",{
			Name  = "BubbleChat";
			Title = "Bubble Chat";
			Icon = client.MatIcons.Chat;
			Size  = {260,57};
			Position = UDim2.new(0, 10, 1, -80);
			AllowMultiple = false;
		})
		
		if window then
			local box = window:Add("TextBox",{
				Text = "Click here or press \";\" to chat";
				PlaceholderText = "Click here or press \";\" to chat";
				BackgroundTransparency = 1;
				TextScaled = true;
				TextSize = 20;
			})
			
			box.FocusLost:Connect(function(enterPressed)
				if enterPressed and service.Player.Character:FindFirstChild('Head') and color and box.Text~='Click here or press ";" to chat' then
					if #box.Text > 0 then
						service.ChatService:Chat(service.Player.Character.Head, service.LaxFilter(box.Text), color)
					end
					box.Text = 'Click here or press ";" to chat'
				end
			end)
			
			window:BindEvent(service.UserInputService.InputBegan, function(inputObject, gameProcessed)
				if not gameProcessed and inputObject.UserInputType == Enum.UserInputType.Keyboard and inputObject.KeyCode == Enum.KeyCode.Semicolon then
					service.RunService.RenderStepped:Wait()
					box:CaptureFocus()
				end
			end)
			
			gTable = window.gTable
			window:Ready()
		end
	end
end
