Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// NOTIFICATION UI SYSTEM ( LOCAL SCRIPT )
- --// By @Kitoo
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local TweenService = game:GetService("TweenService")
- local player = Players.LocalPlayer
- local CP_Success = ReplicatedStorage:WaitForChild("CP_Success")
- local CP_Fail = ReplicatedStorage:WaitForChild("CP_Fail")
- local Summit_Success = ReplicatedStorage:WaitForChild("Summit_Success")
- --====================================================
- -- BUILD UI (SMALL + MODERN)
- --====================================================
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "NotificationUI"
- screenGui.Parent = player:WaitForChild("PlayerGui")
- screenGui.IgnoreGuiInset = true
- screenGui.ResetOnSpawn = false
- local notifFrame = Instance.new("Frame")
- notifFrame.Size = UDim2.new(0, 260, 0, 38) -- << KECIL
- notifFrame.Position = UDim2.new(0.5, -130, 0.06, 0) -- << TENGAH ATAS
- notifFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- notifFrame.BackgroundTransparency = 0.22
- notifFrame.Visible = false
- notifFrame.Parent = screenGui
- notifFrame.ClipsDescendants = true
- notifFrame.BorderSizePixel = 0
- local corner = Instance.new("UICorner", notifFrame)
- corner.CornerRadius = UDim.new(0, 10)
- -- GRADIENT BORDER MODERN
- local border = Instance.new("UIStroke")
- border.Thickness = 1.8
- border.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- border.Parent = notifFrame
- local borderGradient = Instance.new("UIGradient")
- borderGradient.Color = ColorSequence.new({
- ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 180)),
- ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 140, 255)),
- ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 90, 255))
- })
- borderGradient.Rotation = 0
- borderGradient.Parent = border
- -- LIGHT GLOW EFFECT
- local glow = Instance.new("ImageLabel")
- glow.Parent = notifFrame
- glow.AnchorPoint = Vector2.new(0.5, 0.5)
- glow.Position = UDim2.new(0.5, 0, 0.5, 0)
- glow.Size = UDim2.new(1, 30, 1, 18)
- glow.BackgroundTransparency = 1
- glow.Image = "rbxassetid://4996891970"
- glow.ImageColor3 = Color3.fromRGB(0, 150, 255)
- glow.ImageTransparency = 0.7
- -- TITLE LABEL
- 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.TextScaled = true
- textLabel.TextColor3 = Color3.new(1,1,1)
- textLabel.Font = Enum.Font.GothamBold
- textLabel.Text = ""
- textLabel.Parent = notifFrame
- --====================================================
- -- SOUNDS
- --====================================================
- local sounds = Instance.new("Folder")
- sounds.Name = "Sounds"
- sounds.Parent = screenGui
- local function makeSound(id, name)
- local s = Instance.new("Sound")
- s.Name = name
- s.SoundId = "rbxassetid://" .. id
- s.Volume = 1
- s.Parent = sounds
- return s
- end
- local sndCheckpoint = makeSound(9118820410, "Checkpoint")
- local sndFail = makeSound(4590657391, "Fail")
- local sndSummit = makeSound(1837635033, "Summit")
- --====================================================
- -- QUEUE SYSTEM
- --====================================================
- local queue = {}
- local isShowing = false
- local function pushNotification(text, notifType)
- table.insert(queue, {text=text, type=notifType})
- end
- --====================================================
- -- BORDER ROTATION EFFECT
- --====================================================
- task.spawn(function()
- while true do
- borderGradient.Rotation = (tick() * 30) % 360
- task.wait(0.03)
- end
- end)
- --====================================================
- -- DISPLAY
- --====================================================
- --====================================================
- -- DISPLAY (SLIDE IN / SLIDE OUT)
- --====================================================
- local function playNotification(text, notifType)
- isShowing = true
- -- WARNA BERDASARKAN TIPE
- if notifType == "checkpoint" then
- textLabel.TextColor3 = Color3.fromRGB(0,255,160)
- glow.ImageColor3 = Color3.fromRGB(0,255,160)
- sndCheckpoint:Play()
- elseif notifType == "fail" then
- textLabel.TextColor3 = Color3.fromRGB(255,70,70)
- glow.ImageColor3 = Color3.fromRGB(255,70,70)
- sndFail:Play()
- elseif notifType == "summit" then
- textLabel.TextColor3 = Color3.fromRGB(0,180,255)
- glow.ImageColor3 = Color3.fromRGB(0,180,255)
- sndSummit:Play()
- else
- textLabel.TextColor3 = Color3.new(1,1,1)
- end
- textLabel.Text = text
- notifFrame.Visible = true
- glow.ImageTransparency = 1
- notifFrame.BackgroundTransparency = 1
- -- POSISI AWAL (ATAS, BELUM MASUK)
- notifFrame.Position = UDim2.new(0.5, -130, -0.1, 0)
- -- SLIDE IN (turun)
- TweenService:Create(notifFrame, TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
- Position = UDim2.new(0.5, -130, 0.06, 0)
- }):Play()
- -- fade glow + background
- TweenService:Create(glow, TweenInfo.new(0.35), {
- ImageTransparency = 0.7
- }):Play()
- TweenService:Create(notifFrame, TweenInfo.new(0.25), {
- BackgroundTransparency = 0.22
- }):Play()
- -- TAMPIL 2 DETIK
- task.wait(2)
- -- SLIDE OUT (naik ke atas)
- local slideOut = TweenService:Create(notifFrame, TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.In), {
- Position = UDim2.new(0.5, -130, -0.1, 0)
- })
- slideOut:Play()
- -- fade out
- TweenService:Create(notifFrame, TweenInfo.new(0.25), {
- BackgroundTransparency = 1
- }):Play()
- TweenService:Create(glow, TweenInfo.new(0.25), {
- ImageTransparency = 1
- }):Play()
- slideOut.Completed:Wait()
- notifFrame.Visible = false
- isShowing = false
- end
- --====================================================
- -- WORKER QUEUE
- --====================================================
- task.spawn(function()
- while true do
- if not isShowing and #queue > 0 then
- local n = table.remove(queue, 1)
- playNotification(n.text, n.type)
- end
- task.wait()
- end
- end)
- --====================================================
- -- REMOTE LISTENERS
- --====================================================
- CP_Success.OnClientEvent:Connect(function(cp)
- pushNotification("Checkpoint Reached : " .. tostring(cp), "checkpoint")
- end)
- CP_Fail.OnClientEvent:Connect(function()
- pushNotification("❌ Checkpoint Skipped!", "fail")
- end)
- Summit_Success.OnClientEvent:Connect(function()
- pushNotification("🎉 SUMMIT REACHED!", "summit")
- end)
Advertisement
Add Comment
Please, Sign In to add comment