MaxproGlitcher

Notification Gui 1 1/2

Jul 14th, 2024 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.93 KB | None | 0 0
  1. local NotifUI = Instance.new("ScreenGui")
  2. local Holder = Instance.new("ScrollingFrame")
  3. local Buttons = Instance.new("Frame")
  4. local UICorner_3 = Instance.new("UICorner")
  5. local TextLabel_3 = Instance.new("TextLabel")
  6. local TextLabel_4 = Instance.new("TextLabel")
  7. local TextButton_2 = Instance.new("TextButton")
  8. local UICorner_4 = Instance.new("UICorner")
  9. local TextButton_3 = Instance.new("TextButton")
  10. local UICorner_5 = Instance.new("UICorner")
  11. local Sorter = Instance.new("UIListLayout")
  12.  
  13. NotifUI.Name = "NotifUI"
  14. NotifUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  15. NotifUI.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  16.  
  17. Holder.Name = "Holder"
  18. Holder.Parent = NotifUI
  19. Holder.Active = true
  20. Holder.AnchorPoint = Vector2.new(1, 0)
  21. Holder.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  22. Holder.BackgroundTransparency = 1.000
  23. Holder.BorderColor3 = Color3.fromRGB(0, 0, 0)
  24. Holder.BorderSizePixel = 0
  25. Holder.Position = UDim2.new(1, 0, 0, 0)
  26. Holder.Size = UDim2.new(0.25, 0, 1, 0)
  27. Holder.CanvasSize = UDim2.new(0, 0, 0, 0)
  28.  
  29. Sorter.Name = "Sorter"
  30. Sorter.Parent = Holder
  31. Sorter.HorizontalAlignment = Enum.HorizontalAlignment.Center
  32. Sorter.SortOrder = Enum.SortOrder.LayoutOrder
  33. Sorter.VerticalAlignment = Enum.VerticalAlignment.Bottom
  34. Sorter.Padding = UDim.new(0, 10)
  35.  
  36. Module = {}
  37.  
  38. local function SetDefault(v1, v2)
  39. v1 = v1 or {}
  40. local v3 = {}
  41. for i, v in next, v2 do
  42. v3[i] = v1[i] or v2[i]
  43. end
  44. return v3
  45. end
  46.  
  47. function Module:CreateNotification(Options)
  48. local Default = {
  49. Buttons = {
  50. [1] = {
  51. Title = 'Dismiss',
  52. ClosesUI = true,
  53. Callback = function() end
  54. }
  55. },
  56. Title = 'Notification Title',
  57. Content = 'Placeholder notification content',
  58. Length = 5,
  59. NeverExpire = false
  60. }
  61. Options = SetDefault(Options, Default)
  62.  
  63. local Dismiss = Instance.new("Frame")
  64. local UICorner = Instance.new("UICorner")
  65. local TextLabel = Instance.new("TextLabel")
  66. local TextLabel_2 = Instance.new("TextLabel")
  67. local TextButton = Instance.new("TextButton")
  68. local UICorner_2 = Instance.new("UICorner")
  69.  
  70. Dismiss.Name = "Notification"
  71. Dismiss.Parent = Holder
  72. Dismiss.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  73. Dismiss.BackgroundTransparency = 0.300
  74. Dismiss.BorderColor3 = Color3.fromRGB(27, 42, 53)
  75. Dismiss.Position = UDim2.new(0.0996219441, 0, 0.646335304, 0)
  76. Dismiss.Size = UDim2.new(0, 262, 0, 132)
  77. Dismiss.Visible = false
  78.  
  79. UICorner.Parent = Dismiss
  80.  
  81. TextLabel.Parent = Dismiss
  82. TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  83. TextLabel.BackgroundTransparency = 1.000
  84. TextLabel.BorderColor3 = Color3.fromRGB(27, 42, 53)
  85. TextLabel.Position = UDim2.new(0.0572519079, 0, 0.0530303046, 0)
  86. TextLabel.Size = UDim2.new(0, 194, 0, 29)
  87. TextLabel.Font = Enum.Font.GothamMedium
  88. TextLabel.Text = Options.Title
  89. TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  90. TextLabel.TextSize = 16.000
  91. TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  92.  
  93. TextLabel_2.Parent = Dismiss
  94. TextLabel_2.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  95. TextLabel_2.BackgroundTransparency = 1.000
  96. TextLabel_2.BorderColor3 = Color3.fromRGB(27, 42, 53)
  97. TextLabel_2.Position = UDim2.new(0.0572519079, 0, 0.303030312, 0)
  98. TextLabel_2.Size = UDim2.new(0, 233, 0, 52)
  99. TextLabel_2.Font = Enum.Font.Gotham
  100. TextLabel_2.Text = Options.Content
  101. TextLabel_2.TextColor3 = Color3.fromRGB(234, 234, 234)
  102. TextLabel_2.TextSize = 14.000
  103. TextLabel_2.TextWrapped = true
  104. TextLabel_2.TextXAlignment = Enum.TextXAlignment.Left
  105. TextLabel_2.TextYAlignment = Enum.TextYAlignment.Top
  106.  
  107. if Options.Buttons[1] then
  108. TextButton.Parent = Dismiss
  109. TextButton.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  110. TextButton.BorderColor3 = Color3.fromRGB(27, 42, 53)
  111. TextButton.Position = UDim2.new(0.0572519079, 0, 0.696969688, 0)
  112. TextButton.Size = UDim2.new(0, 233, 0, 29)
  113. TextButton.Font = Enum.Font.GothamMedium
  114. TextButton.Text = Options.Buttons[1].Title or "Dismiss"
  115. TextButton.TextColor3 = Color3.fromRGB(0, 0, 0)
  116. TextButton.TextSize = 16.000
  117. TextButton.TextStrokeColor3 = Color3.fromRGB(31, 33, 35)
  118. UICorner_2.CornerRadius = UDim.new(0, 6)
  119. UICorner_2.Parent = TextButton
  120. TextButton.MouseButton1Click:Connect(function()
  121. if Options.Buttons[1].Callback then
  122. task.spawn(Options.Buttons[1].Callback)
  123. end
  124. if Options.Buttons[1].ClosesUI then
  125. Dismiss:Destroy()
  126. end
  127. end)
  128. end
  129. Dismiss.Visible = true
  130. if not Options.NeverExpire then
  131. task.delay(Options.Length, function()
  132. if not Dismiss then return end
  133. local c = {'Frame', 'ScrollingFrame'}
  134. for i, v in next, Dismiss:GetDescendants() do
  135. if v.ClassName:find("Text") then
  136. game:GetService("TweenService"):Create(v, TweenInfo.new(.4), {TextTransparency = 1}):Play()
  137. else
  138. if table.find(c, v.ClassName) then
  139. game:GetService("TweenService"):Create(v, TweenInfo.new(.4), {Transparency = 1}):Play()
  140. end
  141. end
  142. end
  143. task.wait(.4)
  144. Dismiss:Destroy()
  145. end)
  146. end
  147. end
  148.  
  149. return Module
Advertisement
Add Comment
Please, Sign In to add comment