Advertisement
DankGreenMoney

noti

Oct 24th, 2022
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.12 KB | None | 0 0
  1.  
  2. local isExistance = false
  3.  
  4. local Notifyt = Instance.new("ScreenGui")
  5. local NotificationParent = Instance.new("ScrollingFrame")
  6. local UIListLayout = Instance.new("UIListLayout")
  7. local UIPadding = Instance.new("UIPadding")
  8. local Notification = Instance.new("Frame")
  9. local Container = Instance.new("ImageButton")
  10. local Top = Instance.new("ImageLabel")
  11. local Exit = Instance.new("Frame")
  12. local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
  13. local Icon = Instance.new("ImageLabel")
  14. local Button = Instance.new("TextButton")
  15. local Title = Instance.new("TextLabel")
  16. local Accent = Instance.new("Frame")
  17. local Body = Instance.new("Frame")
  18. local Content = Instance.new("TextLabel")
  19. local UIPadding_2 = Instance.new("UIPadding")
  20. local UISizeConstraint = Instance.new("UISizeConstraint")
  21.  
  22. if game.CoreGui:FindFirstChild("Notifyt") then
  23.     isExistance = true
  24.     Notifyt = game.CoreGui.Notifyt
  25.     NotificationParent = Notifyt.NotificationParent
  26.     Notification = Notifyt.Notification
  27. end
  28.  
  29. Notifyt.Name = "Notifyt"
  30. Notifyt.Parent = game.CoreGui
  31. Notifyt.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  32. Notifyt.ResetOnSpawn = false
  33.  
  34. NotificationParent.Name = "NotificationParent"
  35. NotificationParent.Parent = Notifyt
  36. NotificationParent.AnchorPoint = Vector2.new(1, 0)
  37. NotificationParent.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  38. NotificationParent.BackgroundTransparency = 1.000
  39. NotificationParent.BorderSizePixel = 0
  40. NotificationParent.ClipsDescendants = false
  41. NotificationParent.Position = UDim2.new(1, 0, 0, -25)
  42. NotificationParent.Selectable = false
  43. NotificationParent.Size = UDim2.new(0, 275, 1, 0)
  44. NotificationParent.CanvasSize = UDim2.new(0, 0, 0, 0)
  45. NotificationParent.ScrollBarThickness = 0
  46. NotificationParent.ScrollingEnabled = false
  47.  
  48. UIListLayout.Parent = NotificationParent
  49. UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Right
  50. UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  51. UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
  52. UIListLayout.Padding = UDim.new(0, 5)
  53.  
  54. UIPadding.Parent = NotificationParent
  55. UIPadding.PaddingRight = UDim.new(0, 25)
  56.  
  57. Notification.Name = "Notification"
  58. Notification.Parent = Notifyt
  59. Notification.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  60. Notification.BackgroundTransparency = 1.000
  61. Notification.BorderSizePixel = 0
  62. Notification.Position = UDim2.new(1, 0, 0, 0)
  63. Notification.Size = UDim2.new(0, 250, 0, 0)
  64. Notification.Visible = false
  65.  
  66. Container.Name = "Container"
  67. Container.Parent = Notification
  68. Container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  69. Container.BackgroundTransparency = 1.000
  70. Container.BorderSizePixel = 0
  71. Container.Position = UDim2.new(1.14999998, 0, 0, 0)
  72. Container.Size = UDim2.new(1, 0, 0, 0)
  73. Container.Image = "rbxassetid://6296184185"
  74. Container.ImageColor3 = Color3.fromRGB(0, 0, 0)
  75. Container.ImageTransparency = 0.500
  76. Container.ScaleType = Enum.ScaleType.Slice
  77. Container.SliceCenter = Rect.new(512, 512, 512, 512)
  78. Container.SliceScale = 0.012
  79.  
  80. Top.Name = "Top"
  81. Top.Parent = Container
  82. Top.BackgroundColor3 = Color3.fromRGB(248, 248, 248)
  83. Top.BackgroundTransparency = 1.000
  84. Top.BorderSizePixel = 0
  85. Top.Size = UDim2.new(1, 0, 0, 32)
  86. Top.ZIndex = 3
  87. Top.Image = "rbxassetid://6276641225"
  88. Top.ImageColor3 = Color3.fromRGB(0, 0, 0)
  89. Top.ImageTransparency = 0.600
  90. Top.ScaleType = Enum.ScaleType.Slice
  91. Top.SliceCenter = Rect.new(256, 256, 256, 256)
  92. Top.SliceScale = 0.022
  93.  
  94. Exit.Name = "Exit"
  95. Exit.Parent = Top
  96. Exit.AnchorPoint = Vector2.new(1, 0)
  97. Exit.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  98. Exit.BackgroundTransparency = 1.000
  99. Exit.BorderColor3 = Color3.fromRGB(27, 42, 53)
  100. Exit.BorderSizePixel = 0
  101. Exit.ClipsDescendants = true
  102. Exit.LayoutOrder = 3
  103. Exit.Position = UDim2.new(1, 0, 0, 0)
  104. Exit.Size = UDim2.new(1, 0, 1, 0)
  105.  
  106. UIAspectRatioConstraint.Parent = Exit
  107.  
  108. Icon.Name = "Icon"
  109. Icon.Parent = Exit
  110. Icon.AnchorPoint = Vector2.new(0.5, 0.5)
  111. Icon.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  112. Icon.BackgroundTransparency = 1.000
  113. Icon.BorderSizePixel = 0
  114. Icon.Position = UDim2.new(0.5, 0, 0.5, 0)
  115. Icon.Size = UDim2.new(0.5, 0, 0.5, 0)
  116. Icon.Image = "http://www.roblox.com/asset/?id=6415685859"
  117. Icon.ScaleType = Enum.ScaleType.Fit
  118.  
  119. Button.Name = "Button"
  120. Button.Parent = Exit
  121. Button.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  122. Button.BackgroundTransparency = 1.000
  123. Button.BorderSizePixel = 0
  124. Button.Size = UDim2.new(1, 0, 1, 0)
  125. Button.ZIndex = 2
  126. Button.Font = Enum.Font.SourceSans
  127. Button.Text = ""
  128. Button.TextColor3 = Color3.fromRGB(0, 0, 0)
  129. Button.TextSize = 14.000
  130.  
  131. Title.Name = "Title"
  132. Title.Parent = Top
  133. Title.AnchorPoint = Vector2.new(1, 0)
  134. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  135. Title.BackgroundTransparency = 1.000
  136. Title.BorderSizePixel = 0
  137. Title.Position = UDim2.new(1, 0, 0, 0)
  138. Title.Size = UDim2.new(1, -12, 1, 0)
  139. Title.Font = Enum.Font.GothamSemibold
  140. Title.Text = "Notification"
  141. Title.TextColor3 = Color3.fromRGB(240, 240, 240)
  142. Title.TextSize = 14.000
  143. Title.TextWrapped = true
  144. Title.TextXAlignment = Enum.TextXAlignment.Left
  145.  
  146. Accent.Name = "Accent"
  147. Accent.Parent = Top
  148. Accent.AnchorPoint = Vector2.new(0, 1)
  149. Accent.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  150. Accent.BackgroundTransparency = 0.700
  151. Accent.BorderSizePixel = 0
  152. Accent.Position = UDim2.new(0, 0, 1, 0)
  153. Accent.Size = UDim2.new(1, 0, 0, 1)
  154.  
  155. Body.Name = "Body"
  156. Body.Parent = Container
  157. Body.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  158. Body.BackgroundTransparency = 1.000
  159. Body.BorderSizePixel = 0
  160. Body.ClipsDescendants = true
  161. Body.Position = UDim2.new(0, 0, 0, 32)
  162. Body.Size = UDim2.new(1, 0, 0, 0)
  163.  
  164. Content.Name = "Content"
  165. Content.Parent = Body
  166. Content.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  167. Content.BackgroundTransparency = 1.000
  168. Content.BorderSizePixel = 0
  169. Content.Size = UDim2.new(1, 0, 1, 0)
  170. Content.Font = Enum.Font.Gotham
  171. Content.Text = "Message Here. This is an example message prompt."
  172. Content.TextColor3 = Color3.fromRGB(230, 230, 230)
  173. Content.TextSize = 14.000
  174. Content.TextWrapped = true
  175. Content.TextXAlignment = Enum.TextXAlignment.Left
  176. Content.TextYAlignment = Enum.TextYAlignment.Top
  177.  
  178. UIPadding_2.Parent = Body
  179. UIPadding_2.PaddingBottom = UDim.new(0, 12)
  180. UIPadding_2.PaddingLeft = UDim.new(0, 12)
  181. UIPadding_2.PaddingRight = UDim.new(0, 12)
  182. UIPadding_2.PaddingTop = UDim.new(0, 12)
  183.  
  184. UISizeConstraint.Parent = Container
  185. UISizeConstraint.MaxSize = Vector2.new(math.huge, 120)
  186.  
  187. Notification.AutomaticSize = Enum.AutomaticSize.Y
  188. Container.AutomaticSize = Enum.AutomaticSize.Y
  189. Body.AutomaticSize = Enum.AutomaticSize.Y
  190.  
  191. -- remove clones:
  192.  
  193. if isExistance then
  194.     UIListLayout:Destroy()
  195.     UIPadding:Destroy()
  196.     Container:Destroy()
  197. end
  198.  
  199. -- script converted by saypotato
  200.  
  201. local T = game:GetService('TweenService')
  202. local t = TweenInfo.new(0.5, Enum.EasingStyle.Quint)
  203. local tp = NotificationParent
  204.  
  205. function prompt(title, text, closeTime, close)
  206.     local Prompt = Notification:Clone()
  207.     local Sound = Instance.new('Sound', Notification)
  208.  
  209.     Prompt.Visible = true
  210.     Prompt.Container.Top.Title.Text = title
  211.     Prompt.Container.Body.Content.Text = text
  212.  
  213.     Prompt.Parent = NotificationParent
  214.     Sound.SoundId = "rbxassetid://6518811702"
  215.     Sound:Play()
  216.  
  217.     T:Create(Prompt.Container, t, {Position = UDim2.new(0, 0, 0, 0)}):Play()
  218.  
  219.     -- auto size
  220.     Prompt.AutomaticSize = Enum.AutomaticSize.Y
  221.     Prompt.Container.AutomaticSize = Enum.AutomaticSize.Y
  222.     Prompt.Container.Body.AutomaticSize = Enum.AutomaticSize.Y
  223.     Prompt.Container.Body.Content.AutomaticSize = Enum.AutomaticSize.Y
  224.  
  225.     Prompt.Container.Top.Exit.Button.MouseButton1Click:Connect(function()
  226.         T:Create(Prompt.Container, t, {Position = UDim2.new(1.15, 0, 0, 0)}):Play()
  227.         wait(0.48)
  228.         Prompt:Destroy()
  229.     end)
  230.    
  231.     Prompt.Container.Top.Exit.Visible = close
  232.  
  233.     wait(1)
  234.  
  235.     Sound:Destroy()
  236.    
  237.     spawn(function()
  238.         if typeof(closeTime) == "number" then
  239.             task.wait(closeTime)
  240.             local s = pcall(function()
  241.                 T:Create(Prompt.Container, t, {Position = UDim2.new(1.15, 0, 0, 0)}):Play()
  242.                 wait(0.48)
  243.                 Prompt:Destroy()
  244.             end)
  245.             if not s then
  246.                 print('Already closed.')
  247.             end
  248.         end
  249.     end)
  250. end
  251.  
  252. local lib = {}
  253.  
  254. function lib.prompt(title, description, closeTime)
  255.     prompt(title, description, closeTime, true)
  256. end
  257.  
  258. return lib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement