The I have these crates you open, and if you have multiple the first few with have the text notifcation dissapear, but after you do the last one, its stuck there and doesnt dissapear, I have absolutely no idea why. Thank you for your help.
Notification Module:
local NotificationModule = {}
function NotificationModule.GeneralNotification(player, text, textColor)
-- Wait for PlayerGui
local playerGui = player:WaitForChild("PlayerGui")
-- Wait for Notification GUI
local notificationGui = playerGui:WaitForChild("Notification")
-- Get frame and text
local notificationFrame = notificationGui:WaitForChild("NotificationFrame")
local notificationText = notificationFrame:WaitForChild("NotificationText")
-- Ensure the frame resets and starts fresh
notificationFrame.Visible = false
notificationText.Text = ""
-- Update the notification
notificationText.Text = text
notificationText.TextColor3 = textColor
notificationFrame.Visible = true
-- Auto-hide after delay
task.wait(3)
for i = 0, 1, 0.1 do
notificationText.TextTransparency = i
task.wait(0.1) -- Adjust the fade speed here
end
-- After fade-out, hide the frame and reset
notificationFrame.Visible = false
notificationText.TextTransparency = 0 -- Reset transparency for next use
notificationText.Text = ""
end
return NotificationModule
Local script
local NotifEvent = game.ReplicatedStorage.RemoteEvents.NotificationEvent
local NotificationModule = require(game.ReplicatedStorage.ModuleScripts.NotificationModule)
local RarityColors = {
Common = Color3.fromRGB(8, 255, 0), -- Gray
Uncommon = Color3.fromRGB(34, 177, 76), -- Green
Rare = Color3.fromRGB(0, 162, 232), -- Blue
Epic = Color3.fromRGB(163, 73, 164), -- Purple
Legendary = Color3.fromRGB(255, 127, 39), -- Orange
Mythical = Color3.fromRGB(255, 0, 255), -- Magenta
Divine = Color3.fromRGB(255, 215, 0) -- Gold
}
NotifEvent.OnClientEvent:Connect(function(pickedRarity)
print("1")
NotificationModule.GeneralNotification(
game.Players.LocalPlayer,
"You got a " .. tostring(pickedRarity) .. " Sapling!",
RarityColors[pickedRarity],
true
)
print("foolse")
end)