Categories > Coding > Lua >

Custom Notification System

New Reply

Posts: 3

Threads: 3

Joined: Sep, 2024

Reputation: 0

Posted

Tutorial

 

showCustomNotification("TopText", "MiddleText", DurationNotificationWillBeShownFor)
 
Script
 
local NotificationContainer = Instance.new("ScreenGui")
NotificationContainer.Name = "CustomNotifications"
NotificationContainer.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local activeNotifications = {}

local function updateNotificationPositions()
    for i, notification in ipairs(activeNotifications) do
        notification:TweenPosition(
            UDim2.new(1, -260, 1, -110 - (i-1) * 110),
            Enum.EasingDirection.Out,
            Enum.EasingStyle.Quart,
            0.3,
            true
        )
    end
end

local function showCustomNotification(title, text, duration)
    local Notification = Instance.new("Frame")
    Notification.Size = UDim2.new(0, 250, 0, 100)
    Notification.Position = UDim2.new(1, -260, 1, -110)
    Notification.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
    Notification.BorderSizePixel = 0
    Notification.Parent = NotificationContainer

    local UICorner = Instance.new("UICorner")
    UICorner.CornerRadius = UDim.new(0, 10)
    UICorner.Parent = Notification

    local TitleLabel = Instance.new("TextLabel")
    TitleLabel.Size = UDim2.new(1, 0, 0, 30)
    TitleLabel.BackgroundTransparency = 1
    TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
    TitleLabel.TextSize = 18
    TitleLabel.Font = Enum.Font.SourceSansBold
    TitleLabel.Text = title
    TitleLabel.Parent = Notification

    local TextLabel = Instance.new("TextLabel")
    TextLabel.Size = UDim2.new(1, -20, 1, -40)
    TextLabel.Position = UDim2.new(0, 10, 0, 30)
    TextLabel.BackgroundTransparency = 1
    TextLabel.TextColor3 = Color3.fromRGB(200, 200, 200)
    TextLabel.TextSize = 14
    TextLabel.Font = Enum.Font.SourceSans
    TextLabel.Text = text
    TextLabel.TextWrapped = true
    TextLabel.Parent = Notification

    table.insert(activeNotifications, Notification)
    updateNotificationPositions()

    delay(duration, function()
        for i, v in ipairs(activeNotifications) do
            if v == Notification then
                table.remove(activeNotifications, i)
                break
            end
        end
        Notification:Destroy()
        updateNotificationPositions()
    end)
end
showCustomNotification("TopText", "MiddleText", DurationNotificationWillBeShownFor)
 
-------------------------------------------------------------------------------
Yes you Can add Swears
There Is No limit Until it goes Off Screen
Add As Much text as you want But it may Clip off the screen
Websites Are Allowed
Yes This Can Be Used In Other Scripts
No Credit Does Not have to be Incredibly Visible But it must Be Atleast Seen And Known.
- Yes it can be 0.3-1 Transparency
  • 0

  • Comment

Posts: 1

Threads: 0

Joined: Dec, 2024

Reputation: 0

Replied

Always test your script in different scenarios to ensure https://poppyplaytimechapter3.io works as expected. Check for any edge cases where notifications might overlap or not display correctly.

  • 0

  • Comment

Posts: 690

Threads: 69

Joined: Oct, 2022

Reputation: 30

Replied

I feel like this is a bit basic as anyone can code their own notification system without much knowledge.

  • 0

  • Comment

PLUTO_GUY FOR MODERATOR 2024!

---------------------------------

Reading this? Use charm.rest for the best gaming experience in your browser! It is unblocked at school and nice for gaming at home!

Login to unlock the reply editor

Add your reply

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )