How would I make a custom notifications system?
Message appears, if same message gets displayed twice it says (Message Goes Here) x2.
Or if a new message appears, the old message goes up and the message is on the bottom, like this:
local strings = {"Hello!", "Hello!", "Hello!"} -- Add Strings here
function CheckString(str: string)
local stringCount = 1 -- so we can count strings
for i,v in strings do -- iterates through Array
if str == v then -- if string is exactly equal to string
stringCount += 1 -- Add to Count
end -- ends if statement
end -- ends for loop
if stringCount > 1 then -- if count is greater than 1
return string.format(str.." (x%d)", stringCount) -- Ex: "Hello! (x3)"
else -- if number is less than 1
return str -- return the plain string
end
end
local Current = CheckString("Hello!")
print(Current) -- "Hello! (x3)"