Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local NotificationLibrary = {}
- local notifications = {}
- function NotificationLibrary:ShowNotification(text, duration)
- local player = game:GetService("Players").LocalPlayer
- local playerGui = player:FindFirstChild("PlayerGui") or player:WaitForChild("PlayerGui")
- local ultimateNotification = Instance.new("ScreenGui")
- ultimateNotification.Name = "NotificationGui"
- ultimateNotification.Parent = playerGui
- local drag = Instance.new("Frame")
- drag.Name = "NotificationFrame"
- drag.Parent = ultimateNotification
- drag.Active = true
- drag.BackgroundTransparency = 1.000
- drag.Size = UDim2.new(0, 300, 0, 100)
- drag.Position = UDim2.new(0, 10, 1, -110)
- drag.BackgroundColor3 = Color3.fromRGB(64, 64, 64)
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(1, -20, 1, 0)
- textLabel.Position = UDim2.new(0, 10, 0, 0)
- textLabel.BackgroundTransparency = 1
- textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- textLabel.Font = Enum.Font.SourceSans
- textLabel.TextSize = 24
- textLabel.Text = text
- textLabel.TextWrapped = true
- textLabel.Parent = drag
- drag.Draggable = true
- local uiCornerFrame = Instance.new("UICorner")
- uiCornerFrame.CornerRadius = UDim.new(0, 10)
- uiCornerFrame.Parent = drag
- local tweenService = game:GetService("TweenService")
- local fadeInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- tweenService:Create(drag, fadeInfo, {BackgroundTransparency = 0}):Play()
- tweenService:Create(textLabel, fadeInfo, {TextTransparency = 0}):Play()
- task.delay(duration or 3, function()
- local fadeOutInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- tweenService:Create(drag, fadeOutInfo, {BackgroundTransparency = 1}):Play()
- tweenService:Create(textLabel, fadeOutInfo, {TextTransparency = 1}):Play()
- task.wait(0.5)
- ultimateNotification:Destroy()
- end)
- table.insert(notifications, drag)
- end
- NotificationLibrary:ShowNotification("sigma notification", 3)
- print("Notification Library created successfully.")
- return NotificationLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement