Pretty sure NotificationsInQueue[1] returns nil, can you check?
Just ran it and it returned “attempt to index nil with ‘Label’” Is that what you needed?
No, the line above the one you sent, (68) - can you print(NotificationsInQueue[1]) before that, and see if it prints nil?
Ah ok I get what you mean, yes it did return nil.
Yea have you made sanity check, to check if the table (NotificationsInQueue) is empty, before trying to get the first value?
Yes but here I am seeing if the queue is over 0. Should I change it so it checks if the queue equals 0?
Uhm, if it’s not empty, try and print; print(NotificationsInQueue)
It should print whatever is in there
It returned the first one in the queue saying “Void” and all the others normal.
Well that is one step closer. Now next step is to figure out, why is only the first one containing void?
Try not to spawn a new task when you put [1] in nil state.
Nope still the same error. Hmmm
Can I ask what your use-case is, because I have made something similar, with putting notifications in queue.
It will be fired from a Bindable Event sending a request to
From there storing it in queue no matter if the “ActiveNotifications” is empty.
If its empty the update function will sent it to the push Function
Which sends it out to the player
Phew
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.
How does your system store the data. Like for example [1] = {[bla] = “textig”, [bla] = “textig”, [bla] = “textig”}
I stored them in different dictionaries, since it was more organised that way in my use-case.
-- modulescript
module.DisplayNames = {
["TotalSilverCoinsEarned"] = { -- Achievement displaynames
[1] = "Silver Miner I",
[2] = "Silver Miner II",
},
}
module.AchievementData = {
["TotalSilverCoinsEarned"] = { -- Requirement for unlocking the achievement
[1] = 375,
[2] = 750,
},
}
Hmm ok, do you have an idea on how to fix this issue I’m having ill keep looking at your script in the meantime.
Not really no. You could try and start over, not only do you train your developing skills, but it also cleans up some mess, you possible didn’t take into account the first time.
Honestly I probably should its kinda amess right now. Thanks for your help