I have a notification system which works fine, except one issue which is that the first notification will never go away and it will keep covering other new notifications.
I have tried lots of research and haven’t gotten anything better. This is the last option I can think of
Here is the code, its a module script:
local plr = game.Players.LocalPlayer
wait(1)
local UI = plr:WaitForChild("PlayerGui"):WaitForChild("NotificationGui")
local TS = game:GetService("TweenService")
local DS = game:GetService("Debris")
local RS = game:GetService("ReplicatedStorage")
local frame = RS:WaitForChild("NotificationFrame")
local msg1 = UI:WaitForChild("MessageOne")
local msg2 = UI:WaitForChild("MessageTwo")
local module = {}
module.Positions = {
Pos1 = {
Size = UDim2.new(0.193,0,0.08,0),
Position = UDim2.new(0.786,0,0.736,0)
},
Pos2 = {
Size = UDim2.new(0.157,0,0.065,0),
Position = UDim2.new(0.8,0,0.836,0)
}
}
module.SendMessage = function(Message,skip)
if Message then
if msg2.Value then
local frame3 = UI:FindFirstChild("NotificationFrame2")
if frame3 then
frame3.Name = "NotificationFrame3"
local tween = TS:Create(frame3,TweenInfo.new(0.2,Enum.EasingStyle.Linear),{Position = UDim2.new(0.909,0,1.2,0)})
tween:Play()
DS:AddItem(frame3, 0.3)
end
end
if msg1.Value then
msg2.Value = msg1.Value
local frame2 = UI:FindFirstChild("NotificationFrame1")
if frame2 then
frame2.Name = "NotificationFrame2"
local tween = TS:Create(frame2, TweenInfo.new(0.2,Enum.EasingStyle.Linear),module.Positions.Pos2)
tween:Play()
end
end
if not skip then
local frame1 = frame:Clone()
frame1.Parent = UI
frame.Name = "NotificationFrame1"
frame1:WaitForChild("Main"):WaitForChild("Text").Text = Message
frame1.Position = UDim2.new(1.2,0,0.826,0)
local tween = TS:Create(frame1,TweenInfo.new(0.2,Enum.EasingStyle.Linear),module.Positions.Pos1)
tween:Play()
wait(1)
if frame1.Parent then
module.SendMessage(true,true)
end
wait(0.5)
if frame1.Parent then
module.SendMessage(true,true)
end
end
end
end
return module
If you can help that’ll be greatly appreciated but when you do explain how you fixed it so I can learn and know for next time