RXYSETTINGS

NotifCP

Dec 3rd, 2025
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.40 KB | Source Code | 0 0
  1. --// NOTIFICATION UI SYSTEM ( LOCAL SCRIPT )
  2. --// By @Kitoo
  3.  
  4. local Players = game:GetService("Players")
  5. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  6. local TweenService = game:GetService("TweenService")
  7.  
  8. local player = Players.LocalPlayer
  9.  
  10. local CP_Success = ReplicatedStorage:WaitForChild("CP_Success")
  11. local CP_Fail = ReplicatedStorage:WaitForChild("CP_Fail")
  12. local Summit_Success = ReplicatedStorage:WaitForChild("Summit_Success")
  13.  
  14. --====================================================
  15. -- BUILD UI (SMALL + MODERN)
  16. --====================================================
  17. local screenGui = Instance.new("ScreenGui")
  18. screenGui.Name = "NotificationUI"
  19. screenGui.Parent = player:WaitForChild("PlayerGui")
  20. screenGui.IgnoreGuiInset = true
  21. screenGui.ResetOnSpawn = false
  22.  
  23. local notifFrame = Instance.new("Frame")
  24. notifFrame.Size = UDim2.new(0, 260, 0, 38)                         -- << KECIL
  25. notifFrame.Position = UDim2.new(0.5, -130, 0.06, 0)               -- << TENGAH ATAS
  26. notifFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  27. notifFrame.BackgroundTransparency = 0.22
  28. notifFrame.Visible = false
  29. notifFrame.Parent = screenGui
  30. notifFrame.ClipsDescendants = true
  31. notifFrame.BorderSizePixel = 0
  32.  
  33. local corner = Instance.new("UICorner", notifFrame)
  34. corner.CornerRadius = UDim.new(0, 10)
  35.  
  36. -- GRADIENT BORDER MODERN
  37. local border = Instance.new("UIStroke")
  38. border.Thickness = 1.8
  39. border.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  40. border.Parent = notifFrame
  41.  
  42. local borderGradient = Instance.new("UIGradient")
  43. borderGradient.Color = ColorSequence.new({
  44.     ColorSequenceKeypoint.new(0, Color3.fromRGB(0, 255, 180)),
  45.     ColorSequenceKeypoint.new(0.5, Color3.fromRGB(0, 140, 255)),
  46.     ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 90, 255))
  47. })
  48. borderGradient.Rotation = 0
  49. borderGradient.Parent = border
  50.  
  51. -- LIGHT GLOW EFFECT
  52. local glow = Instance.new("ImageLabel")
  53. glow.Parent = notifFrame
  54. glow.AnchorPoint = Vector2.new(0.5, 0.5)
  55. glow.Position = UDim2.new(0.5, 0, 0.5, 0)
  56. glow.Size = UDim2.new(1, 30, 1, 18)
  57. glow.BackgroundTransparency = 1
  58. glow.Image = "rbxassetid://4996891970"
  59. glow.ImageColor3 = Color3.fromRGB(0, 150, 255)
  60. glow.ImageTransparency = 0.7
  61.  
  62. -- TITLE LABEL
  63. local textLabel = Instance.new("TextLabel")
  64. textLabel.Size = UDim2.new(1, -20, 1, 0)
  65. textLabel.Position = UDim2.new(0, 10, 0, 0)
  66. textLabel.BackgroundTransparency = 1
  67. textLabel.TextScaled = true
  68. textLabel.TextColor3 = Color3.new(1,1,1)
  69. textLabel.Font = Enum.Font.GothamBold
  70. textLabel.Text = ""
  71. textLabel.Parent = notifFrame
  72.  
  73. --====================================================
  74. -- SOUNDS
  75. --====================================================
  76. local sounds = Instance.new("Folder")
  77. sounds.Name = "Sounds"
  78. sounds.Parent = screenGui
  79.  
  80. local function makeSound(id, name)
  81.     local s = Instance.new("Sound")
  82.     s.Name = name
  83.     s.SoundId = "rbxassetid://" .. id
  84.     s.Volume = 1
  85.     s.Parent = sounds
  86.     return s
  87. end
  88.  
  89. local sndCheckpoint = makeSound(9118820410, "Checkpoint")
  90. local sndFail      = makeSound(4590657391, "Fail")
  91. local sndSummit    = makeSound(1837635033, "Summit")
  92.  
  93. --====================================================
  94. -- QUEUE SYSTEM
  95. --====================================================
  96. local queue = {}
  97. local isShowing = false
  98.  
  99. local function pushNotification(text, notifType)
  100.     table.insert(queue, {text=text, type=notifType})
  101. end
  102.  
  103. --====================================================
  104. -- BORDER ROTATION EFFECT
  105. --====================================================
  106. task.spawn(function()
  107.     while true do
  108.         borderGradient.Rotation = (tick() * 30) % 360
  109.         task.wait(0.03)
  110.     end
  111. end)
  112.  
  113. --====================================================
  114. -- DISPLAY
  115. --====================================================
  116. --====================================================
  117. -- DISPLAY (SLIDE IN / SLIDE OUT)
  118. --====================================================
  119. local function playNotification(text, notifType)
  120.     isShowing = true
  121.  
  122.     -- WARNA BERDASARKAN TIPE
  123.     if notifType == "checkpoint" then
  124.         textLabel.TextColor3 = Color3.fromRGB(0,255,160)
  125.         glow.ImageColor3 = Color3.fromRGB(0,255,160)
  126.         sndCheckpoint:Play()
  127.  
  128.     elseif notifType == "fail" then
  129.         textLabel.TextColor3 = Color3.fromRGB(255,70,70)
  130.         glow.ImageColor3 = Color3.fromRGB(255,70,70)
  131.         sndFail:Play()
  132.  
  133.     elseif notifType == "summit" then
  134.         textLabel.TextColor3 = Color3.fromRGB(0,180,255)
  135.         glow.ImageColor3 = Color3.fromRGB(0,180,255)
  136.         sndSummit:Play()
  137.  
  138.     else
  139.         textLabel.TextColor3 = Color3.new(1,1,1)
  140.     end
  141.  
  142.     textLabel.Text = text
  143.     notifFrame.Visible = true
  144.     glow.ImageTransparency = 1
  145.     notifFrame.BackgroundTransparency = 1
  146.  
  147.     -- POSISI AWAL (ATAS, BELUM MASUK)
  148.     notifFrame.Position = UDim2.new(0.5, -130, -0.1, 0)
  149.  
  150.     -- SLIDE IN (turun)
  151.     TweenService:Create(notifFrame, TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
  152.         Position = UDim2.new(0.5, -130, 0.06, 0)
  153.     }):Play()
  154.  
  155.     -- fade glow + background
  156.     TweenService:Create(glow, TweenInfo.new(0.35), {
  157.         ImageTransparency = 0.7
  158.     }):Play()
  159.  
  160.     TweenService:Create(notifFrame, TweenInfo.new(0.25), {
  161.         BackgroundTransparency = 0.22
  162.     }):Play()
  163.  
  164.     -- TAMPIL 2 DETIK
  165.     task.wait(2)
  166.  
  167.     -- SLIDE OUT (naik ke atas)
  168.     local slideOut = TweenService:Create(notifFrame, TweenInfo.new(0.35, Enum.EasingStyle.Quint, Enum.EasingDirection.In), {
  169.         Position = UDim2.new(0.5, -130, -0.1, 0)
  170.     })
  171.     slideOut:Play()
  172.  
  173.     -- fade out
  174.     TweenService:Create(notifFrame, TweenInfo.new(0.25), {
  175.         BackgroundTransparency = 1
  176.     }):Play()
  177.  
  178.     TweenService:Create(glow, TweenInfo.new(0.25), {
  179.         ImageTransparency = 1
  180.     }):Play()
  181.  
  182.     slideOut.Completed:Wait()
  183.  
  184.     notifFrame.Visible = false
  185.     isShowing = false
  186. end
  187.  
  188. --====================================================
  189. -- WORKER QUEUE
  190. --====================================================
  191. task.spawn(function()
  192.     while true do
  193.         if not isShowing and #queue > 0 then
  194.             local n = table.remove(queue, 1)
  195.             playNotification(n.text, n.type)
  196.         end
  197.         task.wait()
  198.     end
  199. end)
  200.  
  201. --====================================================
  202. -- REMOTE LISTENERS
  203. --====================================================
  204. CP_Success.OnClientEvent:Connect(function(cp)
  205.     pushNotification("Checkpoint Reached : " .. tostring(cp), "checkpoint")
  206. end)
  207.  
  208. CP_Fail.OnClientEvent:Connect(function()
  209.     pushNotification("❌ Checkpoint Skipped!", "fail")
  210. end)
  211.  
  212. Summit_Success.OnClientEvent:Connect(function()
  213.     pushNotification("🎉 SUMMIT REACHED!", "summit")
  214. end)
Advertisement
Add Comment
Please, Sign In to add comment