return function(q)local O=script.Parent.Parent local V=O.Frame local d=V.Frame local u=d.Message local U=d.Title local S=q.gIndex local L=q.gTable local a=q.Title local m=q.Message local f=q.Scroll local i=q.Time local X=false if not q.Message or not q.Title then L:Destroy()end U.Text=a u.Text=m U.TextTransparency=1 u.TextTransparency=1 U.TextStrokeTransparency=1 u.TextStrokeTransparency=1 V.BackgroundTransparency=1 local Q=10 local P=10 local j=.1 local n=.5 local T=V.BackgroundTransparency local p=P/Q local e=T/Q local o=.1 local A=.1 local function r()L:Ready()for q=1,Q,1 do if u.TextTransparency>j then u.TextTransparency=u.TextTransparency-o U.TextTransparency=U.TextTransparency-o end if u.TextStrokeTransparency>n then u.TextStrokeTransparency=u.TextStrokeTransparency-A U.TextStrokeTransparency=U.TextStrokeTransparency-A end if V.BackgroundTransparency>T then V.BackgroundTransparency=V.BackgroundTransparency-e end service.Wait("\083\116\101\112\112\101\100")end end local function M()if not X then X=true for q=1,Q,1 do if u.TextTransparency<1 then u.TextTransparency=u.TextTransparency+o U.TextTransparency=U.TextTransparency+o end if u.TextStrokeTransparency<1 then u.TextStrokeTransparency=u.TextStrokeTransparency+A U.TextStrokeTransparency=U.TextStrokeTransparency+A end if V.BackgroundTransparency<1 then V.BackgroundTransparency=V.BackgroundTransparency+e d.BackgroundTransparency=V.BackgroundTransparency end service.Wait("\083\116\101\112\112\101\100")end;(service.UnWrap(O)):Destroy()end end L.CustomDestroy=function()M()end r()if not i then local q,O=m:gsub(" ","")O=math.clamp(O/2,4,11)+1 wait(O)else wait(i)end if not X then M()end end
--// All global vars will be wiped/replaced except script

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 = frame.BackgroundTransparency

	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
