The animation sequence (task.wait’s) was causing the script invoking the :Notify function to pause until the notification has dissapeared. To resolve this, I had to wrap the animation sequence with task.spawn . I suggest you also do this so other people wont be running into this issue.
Suggestion: Rather than changing the image directly from a smooth square to a circle, consider creating a frame and inserting a UiCorner instance within it. Then, tween the CornerRadius using Udim.new(). To achieve a circular shape, you can tween the CornerRadius to Udim.new(1, 0); for a smooth square, you can tween it to Udim.new(0.25, 0). This approach ensures a seamless transition between shapes. So thats what i did. If you would like to see how my version of the module performs, then reach out to me on Discord: 6laise
Edit: Changing the images is also not the most optimal solution. People with slower internet connections experience slower image loading, resulting in the notification’s background appearing invisible for several seconds.
Thats why i said create a frame. Btw this is how my version looks.
Edit: As you can see i am tweening the CornerRadius instead of changing the images. This approach creates a seamless transition without any image changing. The recording may be a bit laggy but it looks way better in realtime.
Yeah, that’s the problem, UICorner does not offer Corner Smoothing.
So rounded corners look rough, especially in the part where straight and round meets.
Kay i just adjusted some of the animations and this is the closest it gets.
Edit: I changed the fading out animation a bit. If you don’t like it, then i can adjust it to look like the original. I changed it because it wasnt smooth/fast enough for me.
local BadgeService = game:GetService("BadgeService")
local BadgeID = "id"
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local bannerNotification = require(ReplicatedStorage.BannerNotification)
local function giveBadge(player)
if not BadgeService:UserHasBadge(player.UserId, BadgeID) then
BadgeService:AwardBadge(player.UserId, BadgeID)
bannerNotification:Notify("Notification", "".. player.Name.. " has been awarded the badge!", "rbxassetid://12966400024", 2, nil, player)
end
end
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player then
giveBadge(player)
end
end)
I try to using NumberOfActiveNotifications in client side and I got this:
ReplicatedStorage.BannerNotification_Storage.BannerNotificationModule:137: attempt to get length of a Instance value
I’m using that method in “Handler” LocalScript
local tween_service = game:GetService("TweenService")
local run_service = game:GetService("RunService")
local input_service = game:GetService("UserInputService")
local replicated_storage = game:GetService("ReplicatedStorage")
local info = TweenInfo.new(.5, Enum.EasingStyle.Exponential)
local bannerModule = require(replicated_storage:WaitForChild("BannerNotification_Storage").BannerNotificationModule)
print(bannerModule.NumberOfActiveNotifications()) -- Error
I’m sure it’s an easy solution… but I’m a bit new at scripting and I’m unable to solve my issue. I’m receiving the error “Unable to cast value to Object” at line 126 (specifically notifyEvent:FireClient()
I’ve tried adding print statements in the Notify function, adjusting the player value provided, and digging through the module script and I’m still unable to come up with something.
hey, i havent tried out this yet but im wondering if the ui is fully customizable? like i dont mean just changing the background color i mean like adding uistrokes to the texts, the background, changing fonts, changing the size, etc
Heya! I was working on a system that prevents users from spamming the commands on my admin system (I’m doing so by using the .NumberOfActiveNotifications. Here is my code:
local prefix = "-"
local folder = game.ReplicatedStorage.admin
local BannerNotificationModule = require(game:GetService("ReplicatedStorage").BannerNotification_Storage.BannerNotificationModule)
local configs= {
.3,
Color3.fromRGB(0, 0, 0),
0,
Color3.fromRGB(255, 255, 255),
}
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(message)
print(message)
print(BannerNotificationModule.NumberOfActiveNotifications(plr))
-- ping
if message:sub(1, #prefix) == prefix then
local command = message:sub(#prefix + 1):lower()
if command == "ping" then
print("Pong!")
BannerNotificationModule:Notify("Pong!", "Pong! This is a test notification", "rbxassetid://11326670020", 5, configs,plr)
end
end
end)
end)
Weirdly, my code gives this error when retrieving the .NumberOfActiveNotifications: