I havent tried much but I’ve tried running it through an if then statement and that didn’t work
If you could help me out that would be great. Thank!
Havent gotten to organizing the script yet sorry
local TweenService = game:GetService("TweenService")
local NotificationsInQueue = {}
local ActiveNotifications = 0
local NotificationLimit = 3
local ActiveTime = 6
local QueueNum = #NotificationsInQueue
--local ActiveNotificationNum = #ActiveNotifications
local NotificationBox = script.Parent.Storage:WaitForChild("NotificationBox")
local NotificationSounds = script.Parent:WaitForChild("GUISounds")
local function Push(Lable, Text, Sound)
task.spawn(function()
NotificationsInQueue[1] = nil --//issue here//--
print("yea")
for _,i in pairs(script.Parent.Holder:GetChildren()) do
if i:IsA("Frame") then
i:TweenPosition(UDim2.new(0,0, i.Position.Y.Scale - .300, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad,.3)
end
end
local Clone = NotificationBox:Clone()
ActiveNotifications = ActiveNotifications + 1
task.wait(.7)
Clone.Parent = script.Parent.Holder
Clone.Lable.Text = Lable
Clone.Text.Text = Text
Clone:TweenPosition(UDim2.new(0,0, Clone.Position.Y.Scale, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad,.3)
if Sound == "None" then
NotificationSounds.none:Play()
elseif Sound == "Error" then
NotificationSounds.error:Play()
elseif Sound == "Blop" then
NotificationSounds.blop:Play()
end
task.spawn(function()
task.wait(.3)
task.wait(ActiveTime)
Clone:TweenPosition(UDim2.new(1,0, Clone.Position.Y.Scale, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad,.3)
task.wait(1)
ActiveNotifications = ActiveNotifications - 1
Clone:Destroy()
end)
end)
end
local function FireNotification(Lable, Text, Sound)
print("yea")
table.insert(NotificationsInQueue,{["Queue"] = #NotificationsInQueue+1,["Lable"] = Lable; ["Text"] = Text; ["Sound"] = Sound})
print("yea")
end
local function Update()
if ActiveNotifications < NotificationLimit and #NotificationsInQueue > 0 then
Push(NotificationsInQueue[1].Lable, NotificationsInQueue[1].Text, NotificationsInQueue[1].Sound)
for i, v in pairs(NotificationsInQueue) do
v["Queue"] -= 1
end
end
end
task.spawn(function()
while task.wait(1.40) do
Update()
end
end)
Here is a achievement queue I made some time ago, I’ve removed most of the unneccessary stuff.
local GrantedQueue = {}
local GrantedQueueInProgress = false
local function AchievementGranted(AchievementName, AchievementLevel)
if not AchievementName or not AchievementLevel then return end
local DisplayName = AchievementData_MS.DisplayNames[AchievementName][AchievementLevel]
if not DisplayName then return end
GrantedQueue[DisplayName] = true -- Puts the new achievement into the queue
if not GrantedQueueInProgress then -- Starts the queue if it is not already in progress
GrantedQueueInProgress = true
for DisplayName, _ in pairs(GrantedQueue) do
local NewAchievementFrame = AchievementFrameTemplate:Clone()
NewAchievementFrame.LayoutOrder = tick()
NewAchievementFrame.Parent = Gui.Frame
task.wait(3.5)
NewAchievementFrame:Destroy()
GrantedQueue[DisplayName] = nil
end
GrantedQueueInProgress = false
end
end
local function Intialize(Child)
Child:GetAttributeChangedSignal("Level"):Connect(function()
local AchievementName = Child.Name
local AchievementLevel = Child:GetAttribute("Level")
AchievementGranted(AchievementName, AchievementLevel)
end)
local AchievementName = Child.Name
local AchievementLevel = Child:GetAttribute("Level")
AchievementGranted(AchievementName, AchievementLevel)
end
Achievements.ChildAdded:Connect(function(Child)
Intialize(Child)
end)
for _, Child in pairs(Achievements:GetChildren()) do
Intialize(Child)
end
I don’t know if that kind of queue system can help you out.