function AlertController.addAlert(e,Q,o)local H=baseAlertElement:Clone()for e,Q in pairs(e:GetChildren())do if Q:IsA("\070\114\097\109\101")then Q.LayoutOrder=Q.LayoutOrder+1 end end local Z=H.Message Z.Text=o if Q==Constants.Alert.Fail then Z.TextColor3=Color3.fromRGB(201,67,58)elseif Q==Constants.Alert.Success then Z.TextColor3=Color3.fromRGB(89,156,82)end H.Parent=e delay(5,function()if Z and Z.Parent then local e=TweenService:Create(Z,tweenInfo,{TextTransparency=1})e:Play()e.Completed:Wait()H:Destroy()end end)end return AlertController

function AlertController.addAlert(alerts, type, message)
	local entry = baseAlertElement:Clone()

	for _, child in pairs(alerts:GetChildren()) do
		if child:IsA("Frame") then
			child.LayoutOrder = child.LayoutOrder + 1
		end
	end

	local messageElement = entry.Message
	messageElement.Text = message

	if type == Constants.Alert.Fail then
		messageElement.TextColor3 = Color3.fromRGB(201, 67, 58)
	elseif type == Constants.Alert.Success then
		messageElement.TextColor3 = Color3.fromRGB(89, 156, 82)
	end

	entry.Parent = alerts

	delay(
		5,
		function()
			if messageElement and messageElement.Parent then
				local tween = TweenService:Create(messageElement, tweenInfo, {TextTransparency = 1})

				tween:Play()

				tween.Completed:Wait()

				entry:Destroy()
			end
		end
	)
end

return AlertController
