return function(x)local e,P=x.Title,x.Message if not e or not P then return end local S=x.gTable local j=script.Parent.Parent.BaseClip local s=j.Frame local z=s z.Size=UDim2.new(1,0,0,j.AbsoluteSize.Y)z.Position=UDim2.new(0,0,-1,0)z.Parent=j z.Visible=true local r=z:WaitForChild("\084\101\120\116\066\117\116\116\111\110")local n=z:WaitForChild("\084\111\112")local O=z:WaitForChild("\066\111\100\121")local V=n:WaitForChild("\084\105\116\108\101")local J=O:WaitForChild("\084\111 \078\097\109\101 \076\097\116\101\114")local L=n:WaitForChild("\076\101\102\116")V.Text=e J.Text=P local W=J.TextBounds.Y if W<30 then W=30 else W=W+15 end local g=n.Size.Y.Offset z.Size=UDim2.new(1,0,0,W+g)local function Z()local x local e,P=pcall(function()x=S.BindEvent(j.Changed,function(e)if e=="\065\098\115\111\108\117\116\101\083\105\122\101"then z.Size=UDim2.new(1,0,0,j.AbsoluteSize.Y)local e=J.TextBounds.Y if e<30 then e=30 else e=e+15 end local P=n.Size.Y.Offset z.Size=UDim2.new(1,0,0,e+P)if z~=nil and z.Parent==j then z:TweenPosition(UDim2.new(0,0,.5,-z.Size.Y.Offset/2),"\079\117\116","\081\117\105\110\116",.5,true)else if x then x:Disconnect()end return end end end)end)if P and x then x:Disconnect()return end end S.CustomDestroy=function()S.CustomDestroy=nil S.ClearEvents()pcall(function()z:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(x)if x==Enum.TweenStatus.Completed and z then z:Destroy()elseif x==Enum.TweenStatus.Canceled and z then z:Destroy()end end)wait(.3)end)return S.Destroy()end S:Ready()z:TweenPosition(UDim2.new(0,0,.5,-z.Size.Y.Offset/2),"\079\117\116","\081\117\105\110\116",.5,true,function(x)if x==Enum.TweenStatus.Completed then Z()end end)S.BindEvent(r.MouseButton1Click,function()pcall(function()z:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(x)if x==Enum.TweenStatus.Completed and z then z:Destroy()S:Destroy()elseif x==Enum.TweenStatus.Canceled and z then z:Destroy()S:Destroy()end end)end)end)local t=#J.Text*.1+1 local N,a=string.find(t,"\037\112")if N and a then local x=tonumber(string.sub(t,N))if x>=.5 then t=tonumber(string.sub(t,1,N))+1 else t=tonumber(string.sub(t,1,N))end end if t>15 then t=15 elseif t<=1 then t=2 end L.Text=t.."\046\048\048"for x=t,1,-1 do if not L then break end L.Text=x.."\046\048\048"wait(1)end L.Text="\067\108\111\115\105\110\103\046\046"wait(.3)if z then pcall(function()z:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(x)if x==Enum.TweenStatus.Completed and z then z:Destroy()S:Destroy()elseif x==Enum.TweenStatus.Canceled and z then z:Destroy()S:Destroy()end end)end)end end
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
--// Be sure to update the console gui's code if you change stuff

return function(data)
	local Title, Message = data.Title, data.Message
	if not Title or not Message then
		return
	end

	local gTable = data.gTable
	local baseClip = script.Parent.Parent.BaseClip
	local messageTemplate = baseClip.Frame
	local messageClone = messageTemplate
	messageClone.Size = UDim2.new(1, 0, 0, baseClip.AbsoluteSize.Y)
	messageClone.Position = UDim2.new(0, 0, -1, 0)
	messageClone.Parent = baseClip
	messageClone.Visible = true
	local closeButton = messageClone:WaitForChild("TextButton")
	local Top = messageClone:WaitForChild("Top")
	local Body = messageClone:WaitForChild("Body")
	local topTitle = Top:WaitForChild("Title")
	local bodyText = Body:WaitForChild("To Name Later")
	local Left = Top:WaitForChild("Left")
	topTitle.Text = Title
	bodyText.Text = Message
	local bodyBounds_Y = bodyText.TextBounds.Y
	if bodyBounds_Y < 30 then
		bodyBounds_Y = 30
	else
		bodyBounds_Y = bodyBounds_Y + 15
	end
	local titleSize_Y = Top.Size.Y.Offset
	messageClone.Size = UDim2.new(1, 0, 0, bodyBounds_Y + titleSize_Y)

	local function Resize()
		local toDisconnect
		local Success, Message = pcall(function()
			toDisconnect = gTable.BindEvent(baseClip.Changed, function(Prop)
				if Prop == "AbsoluteSize" then
					messageClone.Size = UDim2.new(1, 0, 0, baseClip.AbsoluteSize.Y)
					local bodyBounds_Y = bodyText.TextBounds.Y
					if bodyBounds_Y < 30 then
						bodyBounds_Y = 30
					else
						bodyBounds_Y = bodyBounds_Y + 15
					end
					local titleSize_Y = Top.Size.Y.Offset
					messageClone.Size = UDim2.new(1, 0, 0, bodyBounds_Y + titleSize_Y)
					if messageClone ~= nil and messageClone.Parent == baseClip then
						messageClone:TweenPosition(
							UDim2.new(0, 0, 0.5, -messageClone.Size.Y.Offset / 2),
							"Out",
							"Quint",
							0.5,
							true
						)
					else
						if toDisconnect then
							toDisconnect:Disconnect()
						end
						return
					end
				end
			end)
		end)
		if Message and toDisconnect then
			toDisconnect:Disconnect()
			return
		end
	end

	gTable.CustomDestroy = function()
		gTable.CustomDestroy = nil
		gTable.ClearEvents()

		pcall(function()
			messageClone:TweenPosition(UDim2.new(0, 0, 1, 0), "Out", "Quint", 0.3, true, function(Done)
				if Done == Enum.TweenStatus.Completed and messageClone then
					messageClone:Destroy()
				elseif Done == Enum.TweenStatus.Canceled and messageClone then
					messageClone:Destroy()
				end
			end)
			wait(0.3)
		end)

		return gTable.Destroy()
	end

	gTable:Ready()
	messageClone:TweenPosition(
		UDim2.new(0, 0, 0.5, -messageClone.Size.Y.Offset / 2),
		"Out",
		"Quint",
		0.5,
		true,
		function(Status)
			if Status == Enum.TweenStatus.Completed then
				Resize()
			end
		end
	)

	gTable.BindEvent(closeButton.MouseButton1Click, function()
		pcall(function()
			messageClone:TweenPosition(UDim2.new(0, 0, 1, 0), "Out", "Quint", 0.3, true, function(Done)
				if Done == Enum.TweenStatus.Completed and messageClone then
					messageClone:Destroy()
					gTable:Destroy()
				elseif Done == Enum.TweenStatus.Canceled and messageClone then
					messageClone:Destroy()
					gTable:Destroy()
				end
			end)
		end)
	end)

	local waitTime = (#bodyText.Text * 0.1) + 1
	local Position_1, Position_2 = string.find(waitTime, "%p")
	if Position_1 and Position_2 then
		local followingNumbers = tonumber(string.sub(waitTime, Position_1))
		if followingNumbers >= 0.5 then
			waitTime = tonumber(string.sub(waitTime, 1, Position_1)) + 1
		else
			waitTime = tonumber(string.sub(waitTime, 1, Position_1))
		end
	end
	if waitTime > 15 then
		waitTime = 15
	elseif waitTime <= 1 then
		waitTime = 2
	end
	Left.Text = waitTime .. ".00"
	for i = waitTime, 1, -1 do
		if not Left then
			break
		end
		Left.Text = i .. ".00"
		wait(1)
	end
	Left.Text = "Closing.."
	wait(0.3)
	if messageClone then
		pcall(function()
			messageClone:TweenPosition(UDim2.new(0, 0, 1, 0), "Out", "Quint", 0.3, true, function(Done)
				if Done == Enum.TweenStatus.Completed and messageClone then
					messageClone:Destroy()
					gTable:Destroy()
				elseif Done == Enum.TweenStatus.Canceled and messageClone then
					messageClone:Destroy()
					gTable:Destroy()
				end
			end)
		end)
	end
end
