return function(G,R)if R then setfenv(1,R)end local d,q=G.Title,G.Message if not d or not q then return end local E=G.gTable local A=script.Parent.Parent.BaseClip local c=A.Frame local o=c o.Size=UDim2.new(1,0,0,A.AbsoluteSize.Y)o.Position=UDim2.new(0,0,-1,0)o.Parent=A o.Visible=true local F=o:WaitForChild("\084\101\120\116\066\117\116\116\111\110")local V=o:WaitForChild("\084\111\112")local g=o:WaitForChild("\066\111\100\121")local m=V:WaitForChild("\084\105\116\108\101")local O=g:WaitForChild("\084\111 \078\097\109\101 \076\097\116\101\114")local M=V:WaitForChild("\076\101\102\116")local z=G.Time m.Text=d O.Text=q local y=O.TextBounds.Y if y<30 then y=30 else y=y+15 end local h=V.Size.Y.Offset o.Size=UDim2.new(1,0,0,y+h)local function s()local G local R,d=pcall(function()G=E.BindEvent(A.Changed,function(R)if R=="\065\098\115\111\108\117\116\101\083\105\122\101"then o.Size=UDim2.new(1,0,0,A.AbsoluteSize.Y)local R=O.TextBounds.Y if R<30 then R=30 else R=R+15 end local d=V.Size.Y.Offset o.Size=UDim2.new(1,0,0,R+d)if o~=nil and o.Parent==A then o:TweenPosition(UDim2.new(0,0,.5,-o.Size.Y.Offset/2),"\079\117\116","\081\117\105\110\116",.5,true)else if G then G:Disconnect()end return end end end)end)if d and G then G:Disconnect()return end end E.CustomDestroy=function()E.CustomDestroy=nil E.ClearEvents()pcall(function()o:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(G)if G==Enum.TweenStatus.Completed and o then o:Destroy()elseif G==Enum.TweenStatus.Canceled and o then o:Destroy()end end)wait(.3)end)return E.Destroy()end E:Ready()o:TweenPosition(UDim2.new(0,0,.5,-o.Size.Y.Offset/2),"\079\117\116","\081\117\105\110\116",.5,true,function(G)if G==Enum.TweenStatus.Completed then s()end end)E.BindEvent(F.MouseButton1Click,function()pcall(function()o:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(G)if G==Enum.TweenStatus.Completed and o then o:Destroy()E:Destroy()elseif G==Enum.TweenStatus.Canceled and o then o:Destroy()E:Destroy()end end)end)end)local X=z or#O.Text*.1+1 local u,L=string.find(X,"\037\112")if u and L then local G=tonumber(string.sub(X,u))if G>=.5 then X=tonumber(string.sub(X,1,u))+1 else X=tonumber(string.sub(X,1,u))end end M.Text=X.."\046\048\048"for G=X,1,-1 do if not M then break end M.Text=G.."\046\048\048"wait(1)end M.Text="\067\108\111\115\105\110\103\046\046"wait(.3)if o then pcall(function()o:TweenPosition(UDim2.new(0,0,1,0),"\079\117\116","\081\117\105\110\116",.3,true,function(G)if G==Enum.TweenStatus.Completed and o then o:Destroy()E:Destroy()elseif G==Enum.TweenStatus.Canceled and o then o:Destroy()E: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, env)
	if env then
		setfenv(1, env)
	end

	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")
	local tim = data.Time
	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 = tim or (#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
