return function(Q,B)if B then setfenv(1,B)end local Z=client.UI.Prepare(script.Parent.Parent)local X=Z.Frame local n=X.Frame local y=n.Message local j=n.Title local l=Q.gIndex local v=Q.gTable local d=Q.Title local q=Q.Message local C=Q.Scroll local U=Q.Time if not Q.Message or not Q.Title then v:Destroy()end j.Text=d y.Text=q local function i()for Q=1,12,1 do y.TextTransparency=y.TextTransparency+.05 j.TextTransparency=j.TextTransparency+.05 y.TextStrokeTransparency=y.TextStrokeTransparency+.05 j.TextStrokeTransparency=j.TextStrokeTransparency+.05 n.BackgroundTransparency=n.BackgroundTransparency+.05 service.Wait("\083\116\101\112\112\101\100")end;(service.UnWrap(Z)):Destroy()end v.CustomDestroy=function()i()end spawn(function()local Q=Instance.new("\083\111\117\110\100",service.LocalContainer())Q.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\055\049\053\050\053\054\049\055\053\051"Q.Volume=.3 wait(.1)Q:Play()wait(1)Q:Destroy()end)v.Ready()X:TweenSize(UDim2.new(0,350,0,150),Enum.EasingDirection.Out,Enum.EasingStyle.Quint,.2)if not U then local Q,B=q:gsub(" ","")B=math.clamp(B/2,4,11)+1 wait(B)else wait(U)end i()end
--// All global vars will be wiped/replaced except script

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
