Hello, I am working on a notification module and I have seen this error where it will run perfectly the first time and when I run it again it will add it to the second one but after I run it again it simply doesnt detect that the second slot is occupied. It constantly just prints that it would create on slot one which I find quite weird. I was looking for some help thanks!
function notificationHandler:createNotification(header, body, timing)
local Header, Body, Timing = header or ' ', body or ' ', timing or 5
if Header == ' ' and Body == ' ' then
warn('Header or Body field must be filled out.')
return
else
if Occupied[1] and Occupied[2] and Occupied[3] then
print('would add to queue')
elseif not Occupied[1] and not Occupied[2] and not Occupied[3] then
print('would add to slot 1')
Occupied[1] = true
elseif Occupied[1] then
print('would add to slot 2')
Occupied[2] = true
elseif Occupied[2] then
print('would add to slot 3')
Occupied[3] = true
end
print(Occupied[1])
print(Occupied[2])
print(Occupied[3])
end
end