return function(o)local M=service.PlayerGui local U=service.Players.LocalPlayer local k=script.Parent.Parent local v=k.Frame.Close local q=k.Frame.Main local m=k.Frame.Title local A=k.Frame.Timer local l=o.gTable local W=o.OnClick local N=o.OnClose local S=o.OnIgnore local J=o.Title local Q=o.Message or o.Text or""local z=o.Time local s=nil if W and type(W)=="\115\116\114\105\110\103"then W=client.Core.LoadCode(W,GetEnv())end if N and type(N)=="\115\116\114\105\110\103"then N=client.Core.LoadCode(N,GetEnv())end if S and type(S)=="\115\116\114\105\110\103"then S=client.Core.LoadCode(S,GetEnv())end local g=client.UI.Get("\078\111\116\105\102\105\099\097\116\105\111\110\072\111\108\100\101\114",nil,true)if not g then local o=service.New("\083\099\114\101\101\110\071\117\105")local M=client.UI.Register(o)local U=service.New("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",o)client.UI.Prepare(o)M.Name="\078\111\116\105\102\105\099\097\116\105\111\110\072\111\108\100\101\114"U.Name="\070\114\097\109\101"U.BackgroundTransparency=1 U.Size=UDim2.new(0,200,.5,0)U.Position=UDim2.new(1,-210,.5,-10)U.CanvasSize=UDim2.new(0,0,0,0)U.ClipsDescendants=false U.ChildAdded:connect(function(o)if#U:GetChildren()==0 then U.Visible=false else U.Visible=true end end)U.ChildRemoved:connect(function(o)if#U:GetChildren()==0 then U.Visible=false else U.Visible=true end end)g=M M:Ready()end local function V(o,M)local U={}for o,M in pairs(o:children())do table.insert(U,1,M)end for o,U in pairs(U)do U.Position=UDim2.new(0,0,1,-75*(o+M))end o.CanvasSize=UDim2.new(0,0,0,#o:children()*75)local k=#o:children()*75-o.AbsoluteWindowSize.Y if k<0 then k=0 end o.CanvasPosition=Vector2.new(0,k)end g=g.Object.Frame m.Text=J k.Name=J q.Text=Q q.MouseButton1Click:connect(function()if k and k.Parent then if W then s=W()end k:Destroy()V(g,0)end end)v.MouseButton1Click:connect(function()if k and k.Parent then if N then s=N()end l:Destroy()V(g,0)end end)V(g,1)k.Parent=g k:TweenPosition(UDim2.new(0,0,1,-75),"\079\117\116","\076\105\110\101\097\114",.2)Routine(function()local o=Instance.new("\083\111\117\110\100",service.LocalContainer())o.SoundId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\050\048\051\055\056\053\053\056\052"o.Volume=.2 wait(.1)o:Play()wait(.5)o:Destroy()end)if z then A.Visible=true Routine(function()repeat A.Text=z wait(1)z=z-1 until z<=0 or not k or not k.Parent if k and k.Parent then if S then s=S()end k:Destroy()V(g,0)end end)end repeat wait()until s~=nil or not k or not k.Parent return s end
--// All global vars will be wiped/replaced except script

return function(data)
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer

	local frame = script.Parent.Parent
	local close = frame.Frame.Close
	local main = frame.Frame.Main
	local title = frame.Frame.Title
	local timer = frame.Frame.Timer

	local gTable = data.gTable
	local clickfunc = data.OnClick
	local closefunc = data.OnClose
	local ignorefunc = data.OnIgnore

	local name = data.Title
	local text = data.Message or data.Text or ""
	local time = data.Time

	local returner = nil

	if clickfunc and type(clickfunc) == "string" then
		clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
	end
	if closefunc and type(closefunc) == "string" then
		closefunc = client.Core.LoadCode(closefunc, GetEnv())
	end
	if ignorefunc and type(ignorefunc) == "string" then
		ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
	end

	--client.UI.Make("NotificationHolder")
	local holder = client.UI.Get("NotificationHolder", nil, true)
	if not holder then
		local hold = service.New("ScreenGui")
		local hTable = client.UI.Register(hold)
		local frame = service.New("ScrollingFrame", hold)
		client.UI.Prepare(hold)
		hTable.Name = "NotificationHolder"
		frame.Name = "Frame"
		frame.BackgroundTransparency = 1
		frame.Size = UDim2.new(0, 200, 0.5, 0)
		frame.Position = UDim2.new(1, -210, 0.5, -10)
		frame.CanvasSize = UDim2.new(0, 0, 0, 0)
		frame.ClipsDescendants = false
		frame.ChildAdded:connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)

		frame.ChildRemoved:connect(function(c)
			if #frame:GetChildren() == 0 then
				frame.Visible = false
			else
				frame.Visible = true
			end
		end)

		holder = hTable
		hTable:Ready()
	end

	local function moveGuis(holder, mod)
		local holdstuff = {}
		for i, v in pairs(holder:children()) do
			table.insert(holdstuff, 1, v)
		end
		for i, v in pairs(holdstuff) do
			v.Position = UDim2.new(0, 0, 1, -75 * (i + mod))
		end
		holder.CanvasSize = UDim2.new(0, 0, 0, (#holder:children() * 75))
		local pos = (((#holder:children()) * 75) - holder.AbsoluteWindowSize.Y)
		if pos < 0 then
			pos = 0
		end
		holder.CanvasPosition = Vector2.new(0, pos)
	end

	holder = holder.Object.Frame
	title.Text = name
	frame.Name = name
	main.Text = text

	main.MouseButton1Click:connect(function()
		if frame and frame.Parent then
			if clickfunc then
				returner = clickfunc()
			end
			frame:Destroy()
			moveGuis(holder, 0)
		end
	end)

	close.MouseButton1Click:connect(function()
		if frame and frame.Parent then
			if closefunc then
				returner = closefunc()
			end
			gTable:Destroy()
			moveGuis(holder, 0)
		end
	end)

	moveGuis(holder, 1)
	frame.Parent = holder
	frame:TweenPosition(UDim2.new(0, 0, 1, -75), "Out", "Linear", 0.2)

	Routine(function()
		local sound = Instance.new("Sound", service.LocalContainer())
		sound.SoundId = "http://www.roblox.com/asset/?id=" .. "203785584" --client.NotificationSound
		sound.Volume = 0.2
		wait(0.1)
		sound:Play()
		wait(0.5)
		sound:Destroy()
	end)

	if time then
		timer.Visible = true
		Routine(function()
			repeat
				timer.Text = time
				--timer.Size=UDim2.new(0,timer.TextBounds.X,0,10)
				wait(1)
				time = time - 1
			until time <= 0 or not frame or not frame.Parent
			if frame and frame.Parent then
				if ignorefunc then
					returner = ignorefunc()
				end
				frame:Destroy()
				moveGuis(holder, 0)
			end
		end)
	end

	repeat
		wait()
	until returner ~= nil or not frame or not frame.Parent

	return returner
end
