return function(k)local J=script.Parent.Parent local g=service.PlayerGui local b=k.Message local I=k.Time or 15 local D={Type="\072\105\110\116",Title="\072\105\110\116";Message=b;Icon="\114\098\120\097\115\115\101\116\105\100\058\047\047\055\053\048\049\049\055\053\055\048\056";Time=os.date("\037\088"),Function=nil}table.insert(client.Variables.CommunicationsHistory,D)service.Events.CommsPanel:Fire(D)local f=client.UI.Get("\072\105\110\116\072\111\108\100\101\114",nil,true)if not f then local k=service.New("\083\099\114\101\101\110\071\117\105")local J=client.UI.Register(k)local g=service.New("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",k)client.UI.Prepare(k)J.Name="\072\105\110\116\072\111\108\100\101\114"g.Name="\070\114\097\109\101"g.BackgroundTransparency=1 g.Size=UDim2.new(1,0,0,150)g.CanvasSize=UDim2.new(0,0,0,0)g.ChildAdded:Connect(function(k)if#g:GetChildren()==0 then g.Visible=false else g.Visible=true end end)g.ChildRemoved:Connect(function(k)if#g:GetChildren()==0 then g.Visible=false else g.Visible=true end end)f=J J:Ready()end f=f.Object.Frame local R=client.UI.Get("\078\111\116\105\102")local U=client.UI.Get("\084\111\112\066\097\114")f.Position=UDim2.new(0,0,0,((R and 30 or 0)+(U and 40 or 0))-35)local u=f:GetChildren()J.Position=UDim2.new(0,0,0,-100)J.Frame.msg.Text=b local N=J.Frame.msg.TextBounds.X local function P(k,J)k=k or 0 local g=#f:GetChildren()for b,I in pairs(f:GetChildren())do if I~=J then local J=(b+k)*28 I.Position=UDim2.new(0,0,0,J)if b~=g then I.Size=UDim2.new(1,0,0,28)end end end end local C=-1 P(-1)J.Parent=f if#f:GetChildren()>5 then C=-2 end UDim2.new(0,0,0,(#f:GetChildren()+C)*28)P(-1)if#f:GetChildren()>5 then local k=(f:GetChildren())[1]P(-2,k)k:Destroy()end wait(k.Time or 5)if J and J.Parent then P(-2,J)J:Destroy()end end


return function(data)
	local gui = script.Parent.Parent
	local playergui = service.PlayerGui
	local str = data.Message
	local time = data.Time or 15
	
	local log  = {
		Type = "Hint";
		Title = "Hint";
		Message = str;
		Icon = "rbxassetid://7501175708";
		Time = os.date("%X");
		Function = nil;
	}

	table.insert(client.Variables.CommunicationsHistory, log) 
	service.Events.CommsPanel:Fire(log)
	
	--client.UI.Make("HintHolder")
	local container = client.UI.Get("HintHolder",nil,true)
	if not container then 
		local holder = service.New("ScreenGui")
		local hTable = client.UI.Register(holder)
		local frame = service.New("ScrollingFrame", holder)
		client.UI.Prepare(holder)
		hTable.Name = "HintHolder"
		frame.Name = "Frame"
		frame.BackgroundTransparency = 1
		frame.Size = UDim2.new(1, 0, 0,150)
		frame.CanvasSize = UDim2.new(0, 0, 0, 0)
		frame.ChildAdded:Connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)
		
		frame.ChildRemoved:Connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)
		
		container = hTable
		hTable:Ready()
	end
	container = container.Object.Frame
	
	--// First things first account for notif :)
	local notif = client.UI.Get("Notif")
	local topbar = client.UI.Get("TopBar")
	
	container.Position = UDim2.new(0,0,0,((notif and 30) or 0) + ((topbar and 40) or 0) - 35)
	
	local children = container:GetChildren()
	
	gui.Position = UDim2.new(0,0,0,-100)
	gui.Frame.msg.Text = str
	local bounds = gui.Frame.msg.TextBounds.X
	
	local function moveGuis(m,ignore)
		m = m or 0
		local max = #container:GetChildren()
		for i,v in pairs(container:GetChildren()) do
			if v~=ignore then
				local y = (i+m)*28
				v.Position = UDim2.new(0,0,0,y)
				if i~=max then v.Size = UDim2.new(1,0,0,28) end
			end
		end
	end
	
	local lom = -1
	moveGuis(-1)
	gui.Parent = container
	if #container:GetChildren()>5 then lom = -2 end
	UDim2.new(0,0,0,(#container:GetChildren()+lom)*28)
	moveGuis(-1)
	--gui:TweenPosition(UDim2.new(0,0,0,(#container:GetChildren()+lom)*28),nil,nil,0.3,true,function() if gui and gui.Parent then moveGuis(-1) end end)
	
	if #container:GetChildren()>5 then
		local gui = container:GetChildren()[1]
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
	
	wait(data.Time or 5)
	
	if gui and gui.Parent then 
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
end
