return function(m,t)if t then setfenv(1,t)end if not m.Message then return end local l=m.gTable local e=script.Parent.Parent.BaseClip local N=e.Frame local C=N local I=C:WaitForChild("\084\101\120\116\066\117\116\116\111\110")local M=C:WaitForChild("\084\111\112")local W=C:WaitForChild("\066\111\100\121")local P=M:WaitForChild("\084\105\116\108\101")local F=W:WaitForChild("\084\111 \078\097\109\101 \076\097\116\101\114")l.BindEvent(I.MouseButton1Click,function()C:TweenPosition(UDim2.new(0,0,0,-C.AbsoluteSize.Y),"\079\117\116","\081\117\105\110\116",.3,true,function(m)if m==Enum.TweenStatus.Completed then C:Destroy()l:Destroy()end end)end)P.Text=m.Title or" "F.Text=m.Message C.Parent=e C.Visible=true C.Position=UDim2.new(0,0,-1,0)l.CustomDestroy=function()l.CustomDestroy=nil l.ClearEvents()pcall(function()C:TweenPosition(UDim2.new(0,0,0,-C.AbsoluteSize.Y),"\079\117\116","\081\117\105\110\116",.3,true,function(m)if m==Enum.TweenStatus.Completed then C:Destroy()l:Destroy()end end)wait(.3)end)l:Destroy()end l:Ready()C:TweenPosition(UDim2.new(0,0,0,0),"\079\117\116","\081\117\105\110\116",.3,true)local z=#F.Text*.1+1 local w=tonumber(m.Wait or z)or z if z<=1 then z=2.5 elseif z>10 then z=10 end wait(w)pcall(function()if C then C:TweenPosition(UDim2.new(0,0,0,-C.AbsoluteSize.Y),"\079\117\116","\081\117\105\110\116",.3,true,function(m)if m==Enum.TweenStatus.Completed then C:Destroy()l:Destroy()end end)end end)end


return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	if not data.Message then return end
	
	local gTable = data.gTable
	local baseClip = script.Parent.Parent.BaseClip
	local hintTemplate = baseClip.Frame
	local hintClone = hintTemplate
	local hintButton = hintClone:WaitForChild('TextButton')
	local hintTop = hintClone:WaitForChild('Top')
	local hintBody = hintClone:WaitForChild('Body')
	local hintTitleText = hintTop:WaitForChild('Title')
	local hintBodyText = hintBody:WaitForChild('To Name Later')
	
	gTable.BindEvent(hintButton.MouseButton1Click, function()
		hintClone:TweenPosition(UDim2.new(0,0,0,-hintClone.AbsoluteSize.Y),'Out','Quint',0.3,true,function(Stat)
			if Stat == Enum.TweenStatus.Completed then
				hintClone:Destroy()
				gTable:Destroy()
			end
		end)
		
	end)
	
	hintTitleText.Text = data.Title or " "
	hintBodyText.Text = data.Message
	hintClone.Parent = baseClip
	hintClone.Visible = true
	hintClone.Position = UDim2.new(0,0,-1,0)
	gTable.CustomDestroy = function()
		gTable.CustomDestroy = nil
		gTable.ClearEvents()
		
		pcall(function()
			hintClone:TweenPosition(UDim2.new(0,0,0,-hintClone.AbsoluteSize.Y),'Out','Quint',0.3,true,function(Stat)
				if Stat == Enum.TweenStatus.Completed then
					hintClone:Destroy()
					gTable:Destroy()
				end
				
			end)
			wait(0.3)
		end)
		
		gTable:Destroy()
	end
	
	gTable:Ready()
	hintClone:TweenPosition(UDim2.new(0,0,0,0),'Out','Quint',0.3,true)
	local def_waitTime = (#hintBodyText.Text*0.1)+1
	local waitTime = tonumber(data.Wait or def_waitTime) or def_waitTime
	if def_waitTime <= 1 then
		def_waitTime = 2.5
	elseif def_waitTime > 10 then
		def_waitTime = 10
	end
	
	wait(waitTime)
	pcall(function()
		if hintClone then
			hintClone:TweenPosition(UDim2.new(0,0,0,-hintClone.AbsoluteSize.Y),'Out','Quint',0.3,true,function(Stat)
				if Stat == Enum.TweenStatus.Completed then
					hintClone:Destroy()
					gTable:Destroy()
				end
			end)
		end
	end)
end
