return function(n)local P=script.Parent.Parent local x=P.Frame local r=x.Frame local N=r.Message local l=r.Title local e=n.gIndex local z=n.gTable local h=n.Title local t=n.Message local p=n.Scroll local T=n.Time local X=false if not n.Message or not n.Title then z:Destroy()end l.Text=h N.Text=t l.TextTransparency=1 N.TextTransparency=1 l.TextStrokeTransparency=1 N.TextStrokeTransparency=1 x.BackgroundTransparency=1 local u=10 local O=10 local G=.1 local a=.5 local Z=.3 local v=O/u local S=Z/u local C=.1 local M=.1 local function I()z:Ready()for n=1,u,1 do if N.TextTransparency>G then N.TextTransparency=N.TextTransparency-C l.TextTransparency=l.TextTransparency-C end if N.TextStrokeTransparency>a then N.TextStrokeTransparency=N.TextStrokeTransparency-M l.TextStrokeTransparency=l.TextStrokeTransparency-M end if x.BackgroundTransparency>Z then x.BackgroundTransparency=x.BackgroundTransparency-S r.BackgroundTransparency=x.BackgroundTransparency end service.Wait("\083\116\101\112\112\101\100")end end local function g()if not X then X=true for n=1,u,1 do if N.TextTransparency<1 then N.TextTransparency=N.TextTransparency+C l.TextTransparency=l.TextTransparency+C end if N.TextStrokeTransparency<1 then N.TextStrokeTransparency=N.TextStrokeTransparency+M l.TextStrokeTransparency=l.TextStrokeTransparency+M end if x.BackgroundTransparency<1 then x.BackgroundTransparency=x.BackgroundTransparency+S r.BackgroundTransparency=x.BackgroundTransparency end service.Wait("\083\116\101\112\112\101\100")end;(service.UnWrap(P)):Destroy()end end z.CustomDestroy=function()g()end I()if not T then local n,P=t:gsub(" ","")P=math.clamp(P/2,4,11)+1 wait(P)else wait(T)end if not X then g()end end


return function(data)
	local gui = script.Parent.Parent--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
	
	local gone = false
	
	if not data.Message or not data.Title then gTable:Destroy() end
	
	ttl.Text = title
	msg.Text = message
	ttl.TextTransparency = 1
	msg.TextTransparency = 1
	ttl.TextStrokeTransparency = 1
	msg.TextStrokeTransparency = 1
	frame.BackgroundTransparency = 1
	
	local fadeSteps = 10
	local blurSize = 10
	local textFade = 0.1
	local strokeFade = 0.5
	local frameFade = 0.3
	
	local blurStep = blurSize/fadeSteps
	local frameStep = frameFade/fadeSteps
	local textStep = 0.1
	local strokeStep = 0.1
	
	local function fadeIn()
		gTable:Ready()
		for i = 1,fadeSteps do
			if msg.TextTransparency>textFade then
				msg.TextTransparency = msg.TextTransparency-textStep
				ttl.TextTransparency = ttl.TextTransparency-textStep
			end
			if msg.TextStrokeTransparency>strokeFade then
				msg.TextStrokeTransparency = msg.TextStrokeTransparency-strokeStep
				ttl.TextStrokeTransparency = ttl.TextStrokeTransparency-strokeStep
			end
			if frame.BackgroundTransparency>frameFade then
				frame.BackgroundTransparency = frame.BackgroundTransparency-frameStep
				frame2.BackgroundTransparency = frame.BackgroundTransparency
			end
			service.Wait("Stepped")
		end
	end
	
	local function fadeOut()
		if not gone then
			gone = true
			for i = 1,fadeSteps do
				if msg.TextTransparency<1 then
					msg.TextTransparency = msg.TextTransparency+textStep
					ttl.TextTransparency = ttl.TextTransparency+textStep
				end
				if msg.TextStrokeTransparency<1 then
					msg.TextStrokeTransparency = msg.TextStrokeTransparency+strokeStep
					ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+strokeStep
				end
				if frame.BackgroundTransparency<1 then
					frame.BackgroundTransparency = frame.BackgroundTransparency+frameStep
					frame2.BackgroundTransparency = frame.BackgroundTransparency
				end
				service.Wait("Stepped")
			end
			service.UnWrap(gui):Destroy()
		end
	end
	
	gTable.CustomDestroy = function()
		fadeOut()
	end
	
	fadeIn()
	if not tim then
		local _,time = message:gsub(" ","")
		time = math.clamp(time/2,4,11)+1
		wait(time)
	else
		wait(tim)
	end
	if not gone then
		fadeOut()
	end
end
