function module.Message(F,Y)local W=messageContainer.Messages local m=.4 local A=Y[1]local l=Y[2]local e=Y[3]local B=Y[4]local b=Y[5]local g=Y[6]local x=main.templates.Message:Clone()for Y,F in pairs(x:GetChildren())do F[getTargetProp(F)]=1 end x.Visible=true if l=="\067\111\117\110\116\100\111\119\110"then local Y={x.Bg,x.Title,x.Desc}x.Title.Text="\067\111\117\110\116\100\111\119\110"x.Title.TextColor3=Color3.fromRGB(200,200,200)x.Desc.TextColor3=g x.Parent=W spawn(function()displayMessages(Y,0,m)end)for Y=1,b,1 do x.Desc.Text=(b+1)-Y wait(1)end displayMessages(Y,1,m)else x.Title.Text=e x.SubTitle.Text=e x.Desc.Text=b x.Desc.TextColor3=g if l=="\083\101\114\118\101\114"or A==nil then x.Pic.Visible=false x.SubTitle.Visible=false else local Y=main.textService:GetTextSize(e,x.Title.TextSize,x.Title.Font,Vector2.new(0,0))x.Pic.Position=UDim2.new(.5,-(Y.X/2+75))x.Pic.Image=(main:GetModule("\099\102")):GetUserImage(A.UserId)x.SubTitle.Text=B end x.Parent=W local Y=getMessageAppearOrder(x)for F=1,#Y,1 do displayMessages(Y[F],0,m)end wait((main:GetModule("\099\102")):GetMessageTime(b))for F=1,#Y,1 do local W=(#Y+1)-F displayMessages(Y[W],1,m)end end x:Destroy()end function module.Hint(F,Y)local W=messageContainer.Hints local m=.6 local A=Y[1]local l=Y[2]local e=Y[3]local B={}local b=main.templates.Hint:Clone()for Y,F in pairs(b:GetChildren())do F[getTargetProp(F)]=1 table.insert(B,F)end b.Desc.Text=l b.Desc.TextColor3=e b.Parent=W b.Visible=true if A=="\067\111\117\110\116\100\111\119\110"then spawn(function()displayMessages(B,0,m)end)for Y=1,l,1 do b.Desc.Text=(l+1)-Y wait(1)end displayMessages(B,1,m)else b.Desc.Text=l b.Desc.TextColor3=e b.Parent=W displayMessages(B,0,m)wait((main:GetModule("\099\102")):GetMessageTime(l))displayMessages(B,1,m)end b:Destroy()end function module.GlobalAnnouncement(F,Y)local W=messageContainer.Messages local m=.4 local A=main.templates.GlobalAnnouncement:Clone()local l=Y.DisplayFrom for Y,F in pairs(A:GetChildren())do F[getTargetProp(F)]=1 end A.Visible=true A.Title.Text=Y.Title A.Pic.Visible=l A.SubTitle.Visible=l local e=main.textService:GetTextSize(A.SubTitle.Text,A.SubTitle.TextSize,A.SubTitle.Font,Vector2.new(0,0))A.Pic.Position=UDim2.new(.5,-(e.X/2+30),0,60)if l then A.Pic.Image=(main:GetModule("\099\102")):GetUserImage(Y.SenderId)A.SubTitle.Text="\070\114\111\109 "..Y.SenderName end A.Desc.TextColor3=Color3.new(Y.Color[1],Y.Color[2],Y.Color[3])A.Desc.Text=Y.Message A.Parent=W local B=getMessageAppearOrder(A)for Y=1,#B,1 do displayMessages(B[Y],0,m)end wait((main:GetModule("\099\102")):GetMessageTime(Y.Message)*1.5)for Y=1,#B,1 do local F=(#B+1)-Y displayMessages(B[F],1,m)end A:Destroy()end function module.ClearMessageContainer(Y)for Y,F in pairs(messageContainer:GetChildren())do for Y,F in pairs(F:GetChildren())do if F:IsA("\070\114\097\109\101")then F.Visible=false end end end end return module
-- << FUNCTIONS >>
function module:Message(args)
	local containerFrame = messageContainer.Messages

	local tweenTime = 0.4
	local mSpeaker = args[1]
	local mType = args[2]
	local mTitle = args[3]
	local mSubTitle = args[4]
	local mDesc = args[5]
	local mDescColor = args[6]

	local message = main.templates.Message:Clone()
	for i, v in pairs(message:GetChildren()) do
		v[getTargetProp(v)] = 1
	end
	message.Visible = true

	if mType == "Countdown" then
		local items = { message.Bg, message.Title, message.Desc }
		message.Title.Text = "Countdown"
		message.Title.TextColor3 = Color3.fromRGB(200, 200, 200)
		message.Desc.TextColor3 = mDescColor
		message.Parent = containerFrame
		spawn(function()
			displayMessages(items, 0, tweenTime)
		end)
		for i = 1, mDesc do
			message.Desc.Text = mDesc + 1 - i
			wait(1)
		end
		displayMessages(items, 1, tweenTime)
	else
		message.Title.Text = mTitle
		message.SubTitle.Text = mTitle
		message.Desc.Text = mDesc
		message.Desc.TextColor3 = mDescColor
		if mType == "Server" or mSpeaker == nil then
			message.Pic.Visible = false
			message.SubTitle.Visible = false
		else
			local size =
				main.textService:GetTextSize(mTitle, message.Title.TextSize, message.Title.Font, Vector2.new(0, 0))
			message.Pic.Position = UDim2.new(0.5, -((size.X / 2) + 75))
			message.Pic.Image = main:GetModule("cf"):GetUserImage(mSpeaker.UserId)
			message.SubTitle.Text = mSubTitle
		end
		message.Parent = containerFrame

		local messageAppearOrder = getMessageAppearOrder(message)
		for i = 1, #messageAppearOrder do
			displayMessages(messageAppearOrder[i], 0, tweenTime)
		end
		wait(main:GetModule("cf"):GetMessageTime(mDesc))
		for i = 1, #messageAppearOrder do
			local newI = #messageAppearOrder + 1 - i
			displayMessages(messageAppearOrder[newI], 1, tweenTime)
		end
	end
	message:Destroy()
end

function module:Hint(args)
	local containerFrame = messageContainer.Hints

	local tweenTime = 0.6
	local hType = args[1]
	local hDesc = args[2]
	local hDescColor = args[3]

	local items = {}
	local hint = main.templates.Hint:Clone()
	for i, v in pairs(hint:GetChildren()) do
		v[getTargetProp(v)] = 1
		table.insert(items, v)
	end
	hint.Desc.Text = hDesc
	hint.Desc.TextColor3 = hDescColor
	hint.Parent = containerFrame
	hint.Visible = true

	if hType == "Countdown" then
		spawn(function()
			displayMessages(items, 0, tweenTime)
		end)
		for i = 1, hDesc do
			hint.Desc.Text = hDesc + 1 - i
			wait(1)
		end
		displayMessages(items, 1, tweenTime)
	else
		hint.Desc.Text = hDesc
		hint.Desc.TextColor3 = hDescColor
		hint.Parent = containerFrame

		displayMessages(items, 0, tweenTime)
		wait(main:GetModule("cf"):GetMessageTime(hDesc))
		displayMessages(items, 1, tweenTime)
	end

	hint:Destroy()
end

function module:GlobalAnnouncement(data)
	local containerFrame = messageContainer.Messages
	local tweenTime = 0.4
	local message = main.templates.GlobalAnnouncement:Clone()
	local displayFrom = data.DisplayFrom

	for i, v in pairs(message:GetChildren()) do
		v[getTargetProp(v)] = 1
	end
	message.Visible = true
	message.Title.Text = data.Title
	message.Pic.Visible = displayFrom
	message.SubTitle.Visible = displayFrom
	local size = main.textService:GetTextSize(
		message.SubTitle.Text,
		message.SubTitle.TextSize,
		message.SubTitle.Font,
		Vector2.new(0, 0)
	)
	message.Pic.Position = UDim2.new(0.5, -((size.X / 2) + 30), 0, 60)
	if displayFrom then
		message.Pic.Image = main:GetModule("cf"):GetUserImage(data.SenderId)
		message.SubTitle.Text = "From " .. data.SenderName
	end
	message.Desc.TextColor3 = Color3.new(data.Color[1], data.Color[2], data.Color[3])
	message.Desc.Text = data.Message
	message.Parent = containerFrame

	local messageAppearOrder = getMessageAppearOrder(message)
	for i = 1, #messageAppearOrder do
		displayMessages(messageAppearOrder[i], 0, tweenTime)
	end
	wait(main:GetModule("cf"):GetMessageTime(data.Message) * 1.5)
	for i = 1, #messageAppearOrder do
		local newI = #messageAppearOrder + 1 - i
		displayMessages(messageAppearOrder[newI], 1, tweenTime)
	end

	message:Destroy()
end

function module:ClearMessageContainer()
	for a, b in pairs(messageContainer:GetChildren()) do
		for c, d in pairs(b:GetChildren()) do
			if d:IsA("Frame") then
				d.Visible = false
			end
		end
	end
end

return module
