Advertisement
CAT_SUS

notification.lua

Jul 22nd, 2023 (edited)
6,744
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.00 KB | None | 1 0
  1. -- [UI notification]
  2.  
  3. local nofs = {}
  4.  
  5. function nofs:Create()
  6.     local nof = Instance.new("ScreenGui")
  7.     local pos = Instance.new("Frame")
  8.     local UIListLayout = Instance.new("UIListLayout")
  9.  
  10.     nof.Name = "nof"
  11.     nof.Parent = game:FindFirstChild('CoreGui') or game.Players.LocalPlayer:WaitForChild("PlayerGui")
  12.     nof.ResetOnSpawn = false
  13.  
  14.     pos.Name = "pos"
  15.     pos.Parent = nof
  16.     pos.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  17.     pos.BackgroundTransparency = 1.000
  18.     pos.BorderColor3 = Color3.fromRGB(0, 0, 0)
  19.     pos.BorderSizePixel = 0
  20.     pos.Position = UDim2.new(0.834357083, 0, 0.349864125, 0)
  21.     pos.Size = UDim2.new(0.152579874, 0, 0.300000012, 0)
  22.  
  23.     UIListLayout.Parent = pos
  24.     UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
  25.     UIListLayout.VerticalAlignment = Enum.VerticalAlignment.Bottom
  26.     UIListLayout.Padding = UDim.new(0, 4)
  27.  
  28.     return function(OwnerString,TitleString,TimeToDel)
  29.         TimeToDel = TimeToDel or 1.5
  30.         OwnerString = OwnerString or "Notification"
  31.         if TitleString then
  32.             local Frame = Instance.new("Frame")
  33.             local UICorner = Instance.new("UICorner")
  34.             local UIStroke = Instance.new("UIStroke")
  35.             local Owner = Instance.new("TextLabel")
  36.             local Title = Instance.new("TextLabel")
  37.             local Time = Instance.new("Frame")
  38.             local UICorner_2 = Instance.new("UICorner")
  39.  
  40.             Frame.Parent = pos
  41.             Frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  42.             Frame.BackgroundTransparency = 0.250
  43.             Frame.BorderColor3 = Color3.fromRGB(0, 0, 0)
  44.             Frame.BorderSizePixel = 0
  45.             Frame.ClipsDescendants = true
  46.             Frame.Size = UDim2.new(0.949999988, 0, 0, 0)
  47.  
  48.             UICorner.CornerRadius = UDim.new(0, 3)
  49.             UICorner.Parent = Frame
  50.  
  51.             UIStroke.Thickness = 1.500
  52.             UIStroke.Transparency = 0.750
  53.             UIStroke.Color = Color3.fromRGB(255, 255, 255)
  54.             UIStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  55.             UIStroke.Parent = Frame
  56.  
  57.             Owner.Name = "Owner"
  58.             Owner.Parent = Frame
  59.             Owner.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  60.             Owner.BackgroundTransparency = 1.000
  61.             Owner.BorderColor3 = Color3.fromRGB(0, 0, 0)
  62.             Owner.BorderSizePixel = 0
  63.             Owner.Position = UDim2.new(0.0250000004, 0, 0.0500000007, 0)
  64.             Owner.Size = UDim2.new(0.899999976, 0, 0.300000012, 0)
  65.             Owner.Font = Enum.Font.GothamBold
  66.             Owner.Text =  OwnerString or "Owner"
  67.             Owner.TextColor3 = Color3.fromRGB(255, 255, 255)
  68.             Owner.TextScaled = true
  69.             Owner.TextSize = 14.000
  70.             Owner.TextTransparency = 0.470
  71.             Owner.TextWrapped = true
  72.             Owner.TextXAlignment = Enum.TextXAlignment.Left
  73.  
  74.             Title.Name = "Title"
  75.             Title.Parent = Frame
  76.             Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  77.             Title.BackgroundTransparency = 1.000
  78.             Title.BorderColor3 = Color3.fromRGB(0, 0, 0)
  79.             Title.BorderSizePixel = 0
  80.             Title.Position = UDim2.new(0.0249998029, 0, 0.342496932, 0)
  81.             Title.Size = UDim2.new(0.900000036, 0, 0.469837189, 0)
  82.             Title.Font = Enum.Font.GothamBold
  83.             Title.Text = TitleString
  84.             Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  85.             Title.TextScaled = true
  86.             Title.TextSize = 14.000
  87.             Title.TextWrapped = true
  88.             Title.TextXAlignment = Enum.TextXAlignment.Left
  89.  
  90.             Time.Name = "Time"
  91.             Time.Parent = Frame
  92.             Time.AnchorPoint = Vector2.new(0, 1)
  93.             Time.BackgroundColor3 = Color3.fromRGB(111, 111, 111)
  94.             Time.BackgroundTransparency = 0.300
  95.             Time.BorderColor3 = Color3.fromRGB(0, 0, 0)
  96.             Time.BorderSizePixel = 0
  97.             Time.Position = UDim2.new(0, 0, 1, 0)
  98.             Time.Size = UDim2.new(0, 0, 0.150000006, 0)
  99.  
  100.             UICorner_2.CornerRadius = UDim.new(0, 3)
  101.             UICorner_2.Parent = Time
  102.            
  103.             local isccoe = false
  104.            
  105.             local function CloseNof()
  106.                 wait(0.3)
  107.                 game:GetService('TweenService'):Create(Frame,TweenInfo.new(0.5),{
  108.                     Size = UDim2.new(0.95, 0,0, 0),
  109.                     BackgroundTransparency = 1,
  110.                 }):Play()
  111.  
  112.                 game:GetService('TweenService'):Create(Title,TweenInfo.new(0.3),{
  113.                     TextTransparency = 1,
  114.                 }):Play()
  115.  
  116.                 game:GetService('TweenService'):Create(Owner,TweenInfo.new(0.3),{
  117.                     TextTransparency = 1,
  118.                 }):Play()
  119.  
  120.                 game:GetService('TweenService'):Create(UIStroke,TweenInfo.new(0.3),{
  121.                     Transparency = 1,
  122.                 }):Play()
  123.  
  124.                 wait(0.55)
  125.                 Frame:Destroy()
  126.             end
  127.            
  128.             coroutine.wrap(function()
  129.                 game:GetService('TweenService'):Create(Frame,TweenInfo.new(0.5,Enum.EasingStyle.Back),{
  130.                     Size = UDim2.new(0.95, 0,0.2, 0)
  131.                 }):Play()
  132.                 wait(0.55)
  133.                 local tween = game:GetService('TweenService'):Create(Time,TweenInfo.new(TimeToDel,Enum.EasingStyle.Linear),{
  134.                     Size = UDim2.new(1,0,0.15,0)
  135.                 })
  136.                 tween:Play()
  137.                 tween.Completed:Wait()
  138.                 if isccoe then
  139.                     return
  140.                 end
  141.                 CloseNof()
  142.             end)()
  143.            
  144.             Frame.InputBegan:Connect(function(a)
  145.                 if a.UserInputType == Enum.UserInputType.Touch or a.UserInputType == Enum.UserInputType.MouseButton1 then
  146.                     if isccoe then
  147.                         return
  148.                     end
  149.                    
  150.                     if TitleString:lower():find("https") then
  151.                         pcall(function()
  152.                             setclipboard(tostring(TitleString))
  153.                         end)
  154.                     end
  155.                    
  156.                     CloseNof()
  157.                 end
  158.             end)
  159.            
  160.             return false
  161.         end
  162.     end
  163. end
  164.  
  165. return nofs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement