return function(M)local r=script.Parent.Parent local f=service.PlayerGui local l=M.Message local Y=M.Time or 15 local F=client.UI.Get("\072\105\110\116\072\111\108\100\101\114",nil,true)if not F then local M=service.New("\083\099\114\101\101\110\071\117\105")local r=client.UI.Register(M)local f=service.New("\083\099\114\111\108\108\105\110\103\070\114\097\109\101",M)client.UI.Prepare(M)r.Name="\072\105\110\116\072\111\108\100\101\114"f.Name="\070\114\097\109\101"f.BackgroundTransparency=1 f.Size=UDim2.new(1,0,0,150)f.CanvasSize=UDim2.new(0,0,0,0)f.ChildAdded:Connect(function(M)if#f:GetChildren()==0 then f.Visible=false else f.Visible=true end end)f.ChildRemoved:Connect(function(M)if#f:GetChildren()==0 then f.Visible=false else f.Visible=true end end)F=r r:Ready()end F=F.Object.Frame local t=client.UI.Get("\078\111\116\105\102")local L=client.UI.Get("\084\111\112\066\097\114")F.Position=UDim2.new(0,0,0,((t and 30 or 0)+(L and 40 or 0))-35)local g=F:children()r.Position=UDim2.new(0,0,0,-100)r.Frame.msg.Text=l local m=r.Frame.msg.TextBounds.X spawn(function()local M=Instance.new("\083\111\117\110\100",service.LocalContainer())M.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047\052\056\057\051\057\048\048\055\050"wait(.1)M:Play()wait(.8)M:Destroy()end)local function W(M,r)M=M or 0 local f=#F:children()for l,Y in pairs(F:children())do if Y~=r then local r=(l+M)*28 Y.Position=UDim2.new(0,0,0,r)if l~=f then Y.Size=UDim2.new(1,0,0,28)end end end end local T=-1 W(-1)r.Parent=F if#F:children()>5 then T=-2 end UDim2.new(0,0,0,(#F:children()+T)*28)W(-1)if#F:children()>5 then local M=(F:children())[1]W(-2,M)M:Destroy()end wait(M.Time or 5)if r and r.Parent then W(-2,r)r:Destroy()end end


return function(data)
	local gui = script.Parent.Parent
	local playergui = service.PlayerGui
	local str = data.Message
	local time = data.Time or 15

	--client.UI.Make("HintHolder")
	local container = client.UI.Get("HintHolder",nil,true)
	if not container then
		local holder = service.New("ScreenGui")
		local hTable = client.UI.Register(holder)
		local frame = service.New("ScrollingFrame", holder)
		client.UI.Prepare(holder)
		hTable.Name = "HintHolder"
		frame.Name = "Frame"
		frame.BackgroundTransparency = 1
		frame.Size = UDim2.new(1, 0, 0,150)
		frame.CanvasSize = UDim2.new(0, 0, 0, 0)
		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)

		container = hTable
		hTable:Ready()
	end
	container = container.Object.Frame

	--// First things first account for notif :)
	local notif = client.UI.Get("Notif")
	local topbar = client.UI.Get("TopBar")

	container.Position = UDim2.new(0,0,0,((notif and 30) or 0) + ((topbar and 40) or 0) - 35)

	local children = container:children()

	gui.Position = UDim2.new(0,0,0,-100)
	gui.Frame.msg.Text = str
	local bounds = gui.Frame.msg.TextBounds.X
	
	spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = "rbxassetid://489390072"
		wait(0.1)
		sound:Play()
		wait(0.8)
		sound:Destroy()
	end)

	local function moveGuis(m,ignore)
		m = m or 0
		local max = #container:children()
		for i,v in pairs(container:children()) do
			if v~=ignore then
				local y = (i+m)*28
				v.Position = UDim2.new(0,0,0,y)
				if i~=max then v.Size = UDim2.new(1,0,0,28) end
			end
		end
	end

	local lom = -1
	moveGuis(-1)
	gui.Parent = container
	if #container:children()>5 then lom = -2 end
	UDim2.new(0,0,0,(#container:children()+lom)*28)
	moveGuis(-1)
	--gui:TweenPosition(UDim2.new(0,0,0,(#container:children()+lom)*28),nil,nil,0.3,true,function() if gui and gui.Parent then moveGuis(-1) end end)

	if #container:children()>5 then
		local gui = container:children()[1]
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end

	wait(data.Time or 5)

	if gui and gui.Parent then
		moveGuis(-2,gui)
		gui:Destroy()
		--gui:TweenPosition(UDim2.new(0,0,0,-100),nil,nil,0.2,true,function() if gui and gui.Parent then gui:Destroy() end end)
	end
end
