return function(L)local A=script.Parent.Parent local g=A.Frame local E=g.Frame local m=E.Message local r=E.Title local j=L.gIndex local i=L.gTable local n=L.Title local O=L.Message local c=L.Scroll local k=L.Time local V=false if not L.Message or not L.Title then i:Destroy()end r.Text=n m.Text=O r.TextTransparency=1 m.TextTransparency=1 r.TextStrokeTransparency=1 m.TextStrokeTransparency=1 g.BackgroundTransparency=1 local p=10 local S=10 local q=.1 local F=.5 local e=.3 local f=S/p local y=e/p local X=.1 local N=.1 local function Q()i:Ready()for L=1,p,1 do if m.TextTransparency>q then m.TextTransparency=m.TextTransparency-X r.TextTransparency=r.TextTransparency-X end if m.TextStrokeTransparency>F then m.TextStrokeTransparency=m.TextStrokeTransparency-N r.TextStrokeTransparency=r.TextStrokeTransparency-N end if g.BackgroundTransparency>e then g.BackgroundTransparency=g.BackgroundTransparency-y E.BackgroundTransparency=g.BackgroundTransparency end service.Wait("\083\116\101\112\112\101\100")end end local function w()if not V then V=true for L=1,p,1 do if m.TextTransparency<1 then m.TextTransparency=m.TextTransparency+X r.TextTransparency=r.TextTransparency+X end if m.TextStrokeTransparency<1 then m.TextStrokeTransparency=m.TextStrokeTransparency+N r.TextStrokeTransparency=r.TextStrokeTransparency+N end if g.BackgroundTransparency<1 then g.BackgroundTransparency=g.BackgroundTransparency+y E.BackgroundTransparency=g.BackgroundTransparency end service.Wait("\083\116\101\112\112\101\100")end;(service.UnWrap(A)):Destroy()end end i.CustomDestroy=function()w()end Q()if not k then local L,A=O:gsub(" ","")A=math.clamp(A/2,4,11)+1 wait(A)else wait(k)end if not V then w()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 = 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
