return function(T,z)if z then setfenv(1,z)end local C=client.UI.Prepare(script.Parent.Parent)local M=C.Frame local s=M.Frame local E=s.Message local H=s.Title local Q=T.gIndex local b=T.gTable local L=T.Title local w=T.Message local m=T.Scroll local U=T.Time if not T.Message or not T.Title then b:Destroy()end H.Text=L E.Text=w local function G()for T=1,12,1 do E.TextTransparency=E.TextTransparency+.05 H.TextTransparency=H.TextTransparency+.05 E.TextStrokeTransparency=E.TextStrokeTransparency+.05 H.TextStrokeTransparency=H.TextStrokeTransparency+.05 s.BackgroundTransparency=s.BackgroundTransparency+.05 service.Wait("\083\116\101\112\112\101\100")end;(service.UnWrap(C)):Destroy()end b.CustomDestroy=function()G()end spawn(function()local T=Instance.new("\083\111\117\110\100",service.LocalContainer())T.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\055\049\053\050\053\054\049\055\053\051"T.Volume=.3 wait(.1)T:Play()wait(1)T:Destroy()end)b.Ready()M:TweenSize(UDim2.new(0,350,0,150),Enum.EasingDirection.Out,Enum.EasingStyle.Quint,.2)if not U then local T,z=w:gsub(" ","")z=math.clamp(z/2,4,11)+1 wait(z)else wait(U)end G()end


return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	local gui = client.UI.Prepare(script.Parent.Parent)
	local frame = gui.Frame
	local frame2 = frame.Frame
	local msg = frame2.Message
	local ttl = frame2.Title

	local gIndex = data.gIndex
	local gTable = data.gTable

	local title = data.Title
	local message = data.Message
	local scroll = data.Scroll
	local tim = data.Time

	if not data.Message or not data.Title then gTable:Destroy() end

	ttl.Text = title
	msg.Text = message
	
	local function fadeOut()
		for i = 1,12 do
			msg.TextTransparency = msg.TextTransparency+0.05
			ttl.TextTransparency = ttl.TextTransparency+0.05
			msg.TextStrokeTransparency = msg.TextStrokeTransparency+0.05
			ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+0.05
			frame2.BackgroundTransparency = frame2.BackgroundTransparency+0.05
			service.Wait("Stepped")
		end
		service.UnWrap(gui):Destroy()
	end
	
	gTable.CustomDestroy = function()
		fadeOut()
	end

	spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = "rbxassetid://7152561753"
		sound.Volume = 0.3
		wait(0.1)
		sound:Play()
		wait(1)
		sound:Destroy()
	end)
	
	gTable.Ready()

	frame:TweenSize(UDim2.new(0, 350, 0, 150), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.2)

	if not tim then
		local _,time = message:gsub(" ","")
		time = math.clamp(time/2,4,11)+1
		wait(time)
	else
		wait(tim)
	end
	
	fadeOut()
end
