client=nil service=nil return function(b)local V=b.FromPlayer local r=b.SessionName local g=nil local T=b.SessionKey local B={}local j=nil local e=b.CanManageUsers local d=nil local I=nil local W={}local function m(b)local V=b.PlayerName local r=false if V~="\042\083\089\083\084\069\077\042"then r=b.PlayerDisplayName end local g=b.Message local T=nil if V=="\042 \083\089\083\084\069\077 \042"then T=I:Add("\070\114\097\109\101",{Size=UDim2.new(1,0,0,25);BackgroundTransparency=1;AutomaticSize="\089",Children={{ClassName="\070\114\097\109\101",Name="\067\072\065\084\070\082\065\077\069";Size=UDim2.new(1,-10,1,-10);Position=UDim2.new(0,5,0,5),BackgroundTransparency=.5,AutomaticSize="\089";Children={{ClassName="\084\101\120\116\076\097\098\101\108";Name="\080\108\097\121\101\114\078\097\109\101",Size=UDim2.new(0,0,0,14);Position=UDim2.new(0,1,0,1),Text="   "..V,TextSize="\049\052";TextXAlignment="\076\101\102\116",BackgroundTransparency=1};{ClassName="\084\101\120\116\076\097\098\101\108";Name="\077\101\115\115\097\103\101",Size=UDim2.new(1,0,0,10);Position=UDim2.new(0,0,0,14),Text="   "..(g and"\060\102\111\110\116 \099\111\108\111\114\061\'\114\103\098\040\050\051\048\044\048\044\048\041\'\062\065\110 \101\114\114\111\114 \104\097\115 \111\099\099\117\114\101\100\060\047\102\111\110\116\062"),TextXAlignment="\076\101\102\116";TextYAlignment="\084\111\112",AutomaticSize="\089",TextWrapped=true;TextScaled=false,RichText=true;BackgroundTransparency=1}}}}})else I:Add("\070\114\097\109\101",{Size=UDim2.new(1,0,0,50);BackgroundTransparency=1,AutomaticSize="\089",Children={{ClassName="\070\114\097\109\101",Name="\067\072\065\084\070\082\065\077\069";Size=UDim2.new(1,-10,1,-10);Position=UDim2.new(0,5,0,5),BackgroundTransparency=.5;AutomaticSize="\089",Children={{ClassName="\073\109\097\103\101\066\117\116\116\111\110",Name="\073\099\111\110",Size=UDim2.new(0,48,0,48),Position=UDim2.new(0,1,0,1);Image=b.Icon and 0},{ClassName="\084\101\120\116\076\097\098\101\108",Name="\080\108\097\121\101\114\078\097\109\101",Size=UDim2.new(1,-55,0,15);Position=UDim2.new(0,55,0,0);Text=not r and V or string.format("\064\037\115 \040\037\115\041",V,r),TextSize="\049\052";TextXAlignment="\076\101\102\116";BackgroundTransparency=1};{ClassName="\084\101\120\116\076\097\098\101\108",Name="\077\101\115\115\097\103\101",Size=UDim2.new(1,-55,0,10),Position=UDim2.new(0,55,0,15);Text=g;TextXAlignment="\076\101\102\116",TextYAlignment="\084\111\112",AutomaticSize="\089";TextWrapped=true;TextScaled=false;RichText=true,BackgroundTransparency=1}}}}})end table.insert(W,T)if#W>200 then W[1]:Destroy()table.remove(W,1)end end if client.UI.Get("\080\114\105\118\097\116\101\067\104\097\116"..r)then return end local U={Name="\080\114\105\118\097\116\101\067\104\097\116"..r;Title="\080\114\105\118\097\116\101 \067\104\097\116",Icon=client.MatIcons.Forum,Size={500;300}}local E=nil function U.OnClose()if E then E:Disconnect()end client.Remote.Send("\083\101\115\115\105\111\110",T,"\076\101\097\118\101\083\101\115\115\105\111\110")end local X=client.UI.Make("\087\105\110\100\111\119",U)I=X:Add("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Size=UDim2.new(1,-105,1,-45);CanvasSize=UDim2.new(0,0,0,0),BackgroundTransparency=.9})g=X:Add("\084\101\120\116\066\111\120",{Text="";PlaceholderText="";Size=UDim2.new(1,-70,0,30);Position=UDim2.new(0,5,1,-35),ClearTextOnFocus=false,TextScaled=true})j=X:Add("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",{Size=UDim2.new(0,100,1,-75),Position=UDim2.new(1,-100,0,0),BackgroundTransparency=.5;AutomaticCanvasSize="\089"})local O={Text="\043",Size=UDim2.new(0,30,0,30),Position=UDim2.new(1,-100,1,-70)}local function n()local b={}local V=next local r,g=service.Players:GetPlayers()while true do local T,j=V(r,g)if not T then break end local e=true for b,V in next,B do if V.UserId==j.UserId then e=false break end end if e then table.insert(b,{Text=string.format("\064\037\115 \040\037\115\041",j.Name,j.DisplayName),Data=service.UnWrap(j)})end end local j=client.UI.Make("\083\101\108\101\099\116\105\111\110\080\114\111\109\112\116",{Name="\065\100\100 \085\115\101\114";Options=b})if j then client.Remote.Send("\083\101\115\115\105\111\110",T,"\065\100\100\080\108\097\121\101\114\084\111\083\101\115\115\105\111\110",j)end end local function Z(b)m({PlayerName="\042 \083\089\083\084\069\077 \042",Message=b,Icon=0})end function O.OnClick()if e then n()return end Z("\060\105\062\089\111\117 \097\114\101 \110\111\116 \097\108\108\111\119\101\100 \116\111 \109\097\110\097\103\101 \117\115\101\114\115\060\047\105\062")end local S=X:Add("\084\101\120\116\066\117\116\116\111\110",O)local z=X:Add("\084\101\120\116\066\117\116\116\111\110",{Text="-",Size=UDim2.new(0,30,0,30),Position=UDim2.new(1,-35,1,-70),OnClick=function()if e then if not d then return end else Z("\060\105\062\089\111\117 \097\114\101 \110\111\116 \097\108\108\111\119\101\100 \116\111 \109\097\110\097\103\101 \117\115\101\114\115\060\047\105\062")return end client.Remote.Send("\083\101\115\115\105\111\110",T,"\082\101\109\111\118\101\080\108\097\121\101\114\070\114\111\109\083\101\115\115\105\111\110",d)d=nil end})local o={Text="\083\101\110\100",Size=UDim2.new(0,60,0,30);Position=UDim2.new(1,-65,1,-35)}local function J()local b=service.Trim(g.Text)if b~=""then client.Remote.Send("\083\101\115\115\105\111\110",T,"\083\101\110\100\077\101\115\115\097\103\101",b)end end function o.OnClick()J()g.Text=""end local t=X:Add("\084\101\120\116\066\117\116\116\111\110",o)local Q=service.New("\085\073\076\105\115\116\076\097\121\111\117\116",{Parent=I;FillDirection="\086\101\114\116\105\099\097\108",HorizontalAlignment="\076\101\102\116";VerticalAlignment="\066\111\116\116\111\109",SortOrder="\076\097\121\111\117\116\079\114\100\101\114"})t.BackgroundColor3=t.BackgroundColor3:lerp(Color3.new(0,0,0),.1)g.FocusLost:Connect(function(b)if b then J()g.Text=""g:CaptureFocus()end end);(Q:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\067\111\110\116\101\110\116\083\105\122\101")):Connect(function()I.CanvasSize=UDim2.new(0,0,0,Q.AbsoluteContentSize.Y)I.CanvasPosition=Vector2.new(0,Q.AbsoluteContentSize.Y)end)if b.History then for b,V in ipairs(b.History)do local r=V.Sender m({PlayerName=r.Name,PlayerDisplayName=r.DisplayName,Message=V.Message;Icon=r.Icon and 0})end end local function C(b)j:ClearAllChildren()B=b for b,V in next,b do local r=j:Add("\084\101\120\116\066\117\116\116\111\110",{Text=string.format("\064\037\115 \040\037\115\041",V.Name,V.DisplayName);Size=UDim2.new(1,0,0,25);TextScaled=true;TextWarped=true,BackgroundTransparency=1})if e then local b=r.BackgroundColor3:Lerp(Color3.fromRGB(9,67,255),.1)if V.UserId and V.UserId~=service.Players.LocalPlayer.UserId then r.MouseButton1Down:Connect(function()for b,V in ipairs(j:GetChildren())do if V:IsA("\084\101\120\116\066\117\116\116\111\110")or V:IsA("\070\114\097\109\101")then V.BackgroundTransparency=1 end end d=V r.BackgroundTransparency=0 r.BackgroundColor3=b end)end end end j.CanvasSize=UDim2.new(0,0,0,(service.New("\085\073\076\105\115\116\076\097\121\111\117\116",{Parent=j,FillDirection="\086\101\114\116\105\099\097\108";HorizontalAlignment="\067\101\110\116\101\114",VerticalAlignment="\084\111\112";SortOrder="\076\097\121\111\117\116\079\114\100\101\114"})).AbsoluteContentSize.Y)end E=service.Events.SessionData:Connect(function(b,V,...)local r={...}if T==b then if V=="\080\108\097\121\101\114\083\101\110\116\077\101\115\115\097\103\101"then local b=r[1]if m then m({PlayerName=b.Name;PlayerDisplayName=b.DisplayName;Message=r[2];Icon=b.Icon and 0})return end else if V=="\085\112\100\097\116\101\080\101\101\114\076\105\115\116"then C(r[1])return end if V=="\082\101\109\111\118\101\100\070\114\111\109\083\101\115\115\105\111\110"then Z("\060\105\062\089\111\117 \104\097\118\101 \098\101\101\110 \114\101\109\111\118\101\100 \102\114\111\109 \116\104\105\115 \099\104\097\116 \115\101\115\115\105\111\110\060\047\105\062")return end if V=="\065\100\100\101\100\084\111\083\101\115\115\105\111\110"then Z("\060\105\062\089\111\117 \104\097\118\101 \098\101\101\110 \097\100\100\101\100 \116\111 \116\104\105\115 \099\104\097\116 \115\101\115\115\105\111\110\060\047\105\062")end end end end)client.Remote.Send("\083\101\115\115\105\111\110",T,"\071\101\116\080\101\101\114\076\105\115\116")local H=X.gTable X:Ready()end


client = nil;
service = nil;
return function(p1)
	local l__FromPlayer__1 = p1.FromPlayer;
	local l__SessionName__2 = p1.SessionName;
	local u1 = nil;
	local l__SessionKey__2 = p1.SessionKey;
	local u3 = {};
	local u4 = nil;
	local l__CanManageUsers__5 = p1.CanManageUsers;
	local u6 = nil;
	local u7 = nil;
	local u8 = {};
	local function u9(p2)
		local l__PlayerName__3 = p2.PlayerName;
		local v4 = false;
		if l__PlayerName__3 ~= "*SYSTEM*" then
			v4 = p2.PlayerDisplayName;
		end;
		local l__Message__5 = p2.Message;
		local v6 = nil;
		if l__PlayerName__3 == "* SYSTEM *" then
			v6 = u7:Add("Frame", {
				Size = UDim2.new(1, 0, 0, 25), 
				BackgroundTransparency = 1, 
				AutomaticSize = "Y", 
				Children = { {
						ClassName = "Frame", 
						Name = "CHATFRAME", 
						Size = UDim2.new(1, -10, 1, -10), 
						Position = UDim2.new(0, 5, 0, 5), 
						BackgroundTransparency = 0.5, 
						AutomaticSize = "Y", 
						Children = { {
								ClassName = "TextLabel", 
								Name = "PlayerName", 
								Size = UDim2.new(0, 0, 0, 14), 
								Position = UDim2.new(0, 1, 0, 1), 
								Text = "   " .. l__PlayerName__3, 
								TextSize = "14", 
								TextXAlignment = "Left", 
								BackgroundTransparency = 1
							}, {
								ClassName = "TextLabel", 
								Name = "Message", 
								Size = UDim2.new(1, 0, 0, 10), 
								Position = UDim2.new(0, 0, 0, 14), 
								Text = "   " .. (l__Message__5 and "<font color='rgb(230,0,0)'>An error has occured</font>"), 
								TextXAlignment = "Left", 
								TextYAlignment = "Top", 
								AutomaticSize = "Y", 
								TextWrapped = true, 
								TextScaled = false, 
								RichText = true, 
								BackgroundTransparency = 1
							} }
					} }
			});
		else
			u7:Add("Frame", {
				Size = UDim2.new(1, 0, 0, 50), 
				BackgroundTransparency = 1, 
				AutomaticSize = "Y", 
				Children = { {
						ClassName = "Frame", 
						Name = "CHATFRAME", 
						Size = UDim2.new(1, -10, 1, -10), 
						Position = UDim2.new(0, 5, 0, 5), 
						BackgroundTransparency = 0.5, 
						AutomaticSize = "Y", 
						Children = { {
								ClassName = "ImageButton", 
								Name = "Icon", 
								Size = UDim2.new(0, 48, 0, 48), 
								Position = UDim2.new(0, 1, 0, 1), 
								Image = p2.Icon and 0
							}, {
								ClassName = "TextLabel", 
								Name = "PlayerName", 
								Size = UDim2.new(1, -55, 0, 15), 
								Position = UDim2.new(0, 55, 0, 0), 
								Text = not v4 and l__PlayerName__3 or string.format("@%s (%s)", l__PlayerName__3, v4), 
								TextSize = "14", 
								TextXAlignment = "Left", 
								BackgroundTransparency = 1
							}, {
								ClassName = "TextLabel", 
								Name = "Message", 
								Size = UDim2.new(1, -55, 0, 10), 
								Position = UDim2.new(0, 55, 0, 15), 
								Text = l__Message__5, 
								TextXAlignment = "Left", 
								TextYAlignment = "Top", 
								AutomaticSize = "Y", 
								TextWrapped = true, 
								TextScaled = false, 
								RichText = true, 
								BackgroundTransparency = 1
							} }
					} }
			});
		end;
		table.insert(u8, v6);
		if #u8 > 200 then
			u8[1]:Destroy();
			table.remove(u8, 1);
		end;
	end;
	if client.UI.Get("PrivateChat" .. l__SessionName__2) then
		return;
	end;
	local v7 = {
		Name = "PrivateChat" .. l__SessionName__2, 
		Title = "Private Chat", 
		Icon = client.MatIcons.Forum, 
		Size = { 500, 300 }
	};
	local u10 = nil;
	function v7.OnClose()
		if u10 then
			u10:Disconnect();
		end;
		client.Remote.Send("Session", l__SessionKey__2, "LeaveSession");
	end;
	local v8 = client.UI.Make("Window", v7);
	u7 = v8:Add("ScrollingFrame", {
		Size = UDim2.new(1, -105, 1, -45), 
		CanvasSize = UDim2.new(0, 0, 0, 0), 
		BackgroundTransparency = 0.9
	});
	u1 = v8:Add("TextBox", {
		Text = "", 
		PlaceholderText = "", 
		Size = UDim2.new(1, -70, 0, 30), 
		Position = UDim2.new(0, 5, 1, -35), 
		ClearTextOnFocus = false, 
		TextScaled = true
	});
	u4 = v8:Add("ScrollingFrame", {
		Size = UDim2.new(0, 100, 1, -75), 
		Position = UDim2.new(1, -100, 0, 0), 
		BackgroundTransparency = 0.5, 
		AutomaticCanvasSize = "Y"
	});
	local v9 = {
		Text = "+", 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -100, 1, -70)
	};
	local function u11()
		local v10 = {};
		local l__next__11 = next;
		local v12, v13 = service.Players:GetPlayers();
		while true do
			local v14, v15 = l__next__11(v12, v13);
			if not v14 then
				break;
			end;
			local v16 = true;
			for v17, v18 in next, u3 do
				if v18.UserId == v15.UserId then
					v16 = false;
					break;
				end;
			end;
			if v16 then
				table.insert(v10, {
					Text = string.format("@%s (%s)", v15.Name, v15.DisplayName), 
					Data = service.UnWrap(v15)
				});
			end;		
		end;
		local v19 = client.UI.Make("SelectionPrompt", {
			Name = "Add User", 
			Options = v10
		});
		if v19 then
			client.Remote.Send("Session", l__SessionKey__2, "AddPlayerToSession", v19);
		end;
	end;
	local function u12(p3)
		u9({
			PlayerName = "* SYSTEM *", 
			Message = p3, 
			Icon = 0
		});
	end;
	function v9.OnClick()
		if l__CanManageUsers__5 then
			u11();
			return;
		end;
		u12("<i>You are not allowed to manage users</i>");
	end;
	local v20 = v8:Add("TextButton", v9);
	local v21 = v8:Add("TextButton", {
		Text = "-", 
		Size = UDim2.new(0, 30, 0, 30), 
		Position = UDim2.new(1, -35, 1, -70), 
		OnClick = function()
			if l__CanManageUsers__5 then
				if not u6 then
					return;
				end;
			else
				u12("<i>You are not allowed to manage users</i>");
				return;
			end;
			client.Remote.Send("Session", l__SessionKey__2, "RemovePlayerFromSession", u6);
			u6 = nil;
		end
	});
	local v22 = {
		Text = "Send", 
		Size = UDim2.new(0, 60, 0, 30), 
		Position = UDim2.new(1, -65, 1, -35)
	};
	local function u13()
		local v23 = service.Trim(u1.Text);
		if v23 ~= "" then
			client.Remote.Send("Session", l__SessionKey__2, "SendMessage", v23);
		end;
	end;
	function v22.OnClick()
		u13();
		u1.Text = "";
	end;
	local v24 = v8:Add("TextButton", v22);
	local v25 = service.New("UIListLayout", {
		Parent = u7, 
		FillDirection = "Vertical", 
		HorizontalAlignment = "Left", 
		VerticalAlignment = "Bottom", 
		SortOrder = "LayoutOrder"
	});
	v24.BackgroundColor3 = v24.BackgroundColor3:lerp(Color3.new(0, 0, 0), 0.1);
	u1.FocusLost:Connect(function(p4)
		if p4 then
			u13();
			u1.Text = "";
			u1:CaptureFocus();
		end;
	end);
	v25:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
		u7.CanvasSize = UDim2.new(0, 0, 0, v25.AbsoluteContentSize.Y);
		u7.CanvasPosition = Vector2.new(0, v25.AbsoluteContentSize.Y);
	end);
	if p1.History then
		for v26, v27 in ipairs(p1.History) do
			local l__Sender__28 = v27.Sender;
			u9({
				PlayerName = l__Sender__28.Name, 
				PlayerDisplayName = l__Sender__28.DisplayName, 
				Message = v27.Message, 
				Icon = l__Sender__28.Icon and 0
			});
		end;
	end;
	local function u14(p5)
		u4:ClearAllChildren();
		u3 = p5;
		for v29, v30 in next, p5 do
			local v31 = u4:Add("TextButton", {
				Text = string.format("@%s (%s)", v30.Name, v30.DisplayName), 
				Size = UDim2.new(1, 0, 0, 25), 
				TextScaled = true, 
				TextWarped = true, 
				BackgroundTransparency = 1
			});
			if l__CanManageUsers__5 then
				local v32 = v31.BackgroundColor3:Lerp(Color3.fromRGB(9, 67, 255), 0.1);
				if v30.UserId and v30.UserId ~= service.Players.LocalPlayer.UserId then
					v31.MouseButton1Down:Connect(function()
						for v33, v34 in ipairs(u4:GetChildren()) do
							if v34:IsA("TextButton") or v34:IsA("Frame") then
								v34.BackgroundTransparency = 1;
							end;
						end;
						u6 = v30;
						v31.BackgroundTransparency = 0;
						v31.BackgroundColor3 = v32;
					end);
				end;
			end;
		end;
		u4.CanvasSize = UDim2.new(0, 0, 0, service.New("UIListLayout", {
			Parent = u4, 
			FillDirection = "Vertical", 
			HorizontalAlignment = "Center", 
			VerticalAlignment = "Top", 
			SortOrder = "LayoutOrder"
		}).AbsoluteContentSize.Y);
	end;
	u10 = service.Events.SessionData:Connect(function(p6, p7, ...)
		local v35 = { ... };
		if l__SessionKey__2 == p6 then
			if p7 == "PlayerSentMessage" then
				local v36 = v35[1];
				if u9 then
					u9({
						PlayerName = v36.Name, 
						PlayerDisplayName = v36.DisplayName, 
						Message = v35[2], 
						Icon = v36.Icon and 0
					});
					return;
				end;
			else
				if p7 == "UpdatePeerList" then
					u14(v35[1]);
					return;
				end;
				if p7 == "RemovedFromSession" then
					u12("<i>You have been removed from this chat session</i>");
					return;
				end;
				if p7 == "AddedToSession" then
					u12("<i>You have been added to this chat session</i>");
				end;
			end;
		end;
	end);
	client.Remote.Send("Session", l__SessionKey__2, "GetPeerList");
	local l__gTable__37 = v8.gTable;
	v8:Ready();
end;
