Advertisement
Vortex23

KeyRBLX Notify

Aug 5th, 2024 (edited)
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.71 KB | None | 0 0
  1. --[[
  2.     Notify Lib by me: mr.xrer
  3.     Changelog:
  4.         25.07.2023:
  5.             - Time argument, autoclose
  6.             - Better animations
  7. --]]
  8. local NotificationLibrary = {}
  9.  
  10. local CoreGUI = game:GetService("CoreGui")
  11. local TS = game:GetService("TweenService")
  12.  
  13. local HIDEUI = get_hidden_gui or gethui
  14. if syn and typeof(syn) == "table" and RenderWindow then syn.protect_gui = gethui; end
  15. local function Hide_UI(gui)
  16.     if HIDEUI then
  17.         gui["Parent"] = HIDEUI()
  18.     elseif (not is_sirhurt_closure) and (syn and syn.protect_gui) then
  19.         syn.protect_gui(gui)
  20.         gui["Parent"] = CoreGUI
  21.     elseif CoreGUI:FindFirstChild('RobloxGui') then
  22.         gui["Parent"] = CoreGUI.RobloxGui
  23.     else
  24.         gui["Parent"] = CoreGUI
  25.     end
  26. end
  27.  
  28. local screen_gui = Instance.new("ScreenGui")
  29. Hide_UI(screen_gui)
  30.  
  31. local frame = Instance.new("Frame")
  32. frame.AnchorPoint = Vector2.new(0.5, 0.949999988079071)
  33. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  34. frame.BackgroundTransparency = 1
  35. frame.BorderColor3 = Color3.new(0, 0, 0)
  36. frame.BorderSizePixel = 0
  37. frame.Position = UDim2.new(0.5, 0, 0.954999983, 0)
  38. frame.Size = UDim2.new(0, 100, 0, 100)
  39. frame.Visible = true
  40. frame.Parent = screen_gui
  41.  
  42. local uilist_layout = Instance.new("UIListLayout")
  43. uilist_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
  44. uilist_layout.SortOrder = Enum.SortOrder.LayoutOrder
  45. uilist_layout.VerticalAlignment = Enum.VerticalAlignment.Bottom
  46. uilist_layout.Parent = frame
  47.    
  48. function NotificationLibrary:SendNotification(mode, text, timee)
  49.     local frame_2 = Instance.new("Frame")
  50.     frame_2.BackgroundColor3 = Color3.new(1, 1, 1)
  51.     frame_2.BorderColor3 = Color3.new(0, 0, 0)
  52.     frame_2.BorderSizePixel = 0
  53.     frame_2.BackgroundTransparency = 1
  54.     frame_2.Size = UDim2.new(0, 100, 0, 0)
  55.     frame_2.Visible = true
  56.     frame_2.Parent = frame
  57.    
  58.     -- Main Notification Frame
  59.     local frame_3 = Instance.new("Frame")
  60.     frame_3.AnchorPoint = Vector2.new(0.5, 1)
  61.     frame_3.AutomaticSize = Enum.AutomaticSize.X
  62.     frame_3.BackgroundColor3 = Color3.new(0.141176, 0.141176, 0.141176)
  63.     frame_3.BackgroundTransparency = 0.20000000298023224
  64.     frame_3.BorderColor3 = Color3.new(0, 0, 0)
  65.     frame_3.Position = UDim2.new(0.5, 0, 1, 60)
  66.     frame_3.Size = UDim2.new(0, 0, 0, 30)
  67.     frame_3.Visible = true
  68.     frame_3.Parent = frame_2
  69.  
  70.     local uicorner = Instance.new("UICorner")
  71.     uicorner.CornerRadius = UDim.new(0, 6)
  72.     uicorner.Parent = frame_3
  73.  
  74.     local uipadding = Instance.new("UIPadding")
  75.     uipadding.PaddingBottom = UDim.new(0, 3)
  76.     uipadding.PaddingLeft = UDim.new(0, 3)
  77.     uipadding.PaddingRight = UDim.new(0, 3)
  78.     uipadding.PaddingTop = UDim.new(0, 3)
  79.     uipadding.Parent = frame_3
  80.  
  81.     local uistroke = Instance.new("UIStroke")
  82.     uistroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  83.     uistroke.Color = Color3.new(0.0313726, 0.0313726, 0.0313726)
  84.     uistroke.Parent = frame_3
  85.  
  86.     local text_label = Instance.new("TextLabel")
  87.     text_label.Font = Enum.Font.Gotham
  88.     text_label.Text = mode .. ": " .. text
  89.     text_label.TextColor3 = Color3.new(0.784314, 0.784314, 0.784314)
  90.     text_label.TextSize = 14
  91.     text_label.AutomaticSize = Enum.AutomaticSize.X
  92.     text_label.BackgroundColor3 = Color3.new(1, 1, 1)
  93.     text_label.BackgroundTransparency = 1
  94.     text_label.BorderColor3 = Color3.new(0, 0, 0)
  95.     text_label.BorderSizePixel = 0
  96.     text_label.Size = UDim2.new(0, 0, 0, 24)
  97.     text_label.Visible = true
  98.     text_label.Parent = frame_3
  99.  
  100.     local uipadding_2 = Instance.new("UIPadding")
  101.     uipadding_2.PaddingLeft = UDim.new(0, 5)
  102.     uipadding_2.PaddingRight = UDim.new(0, 30)
  103.     uipadding_2.Parent = text_label
  104.  
  105.     local text_button = Instance.new("TextButton")
  106.     text_button.Font = Enum.Font.SourceSans
  107.     text_button.Text = ""
  108.     text_button.TextColor3 = Color3.new(0, 0, 0)
  109.     text_button.TextSize = 14
  110.     text_button.AnchorPoint = Vector2.new(1, 0.5)
  111.     text_button.BackgroundColor3 = Color3.new(0, 0, 0)
  112.     text_button.BackgroundTransparency = 1
  113.     text_button.BorderColor3 = Color3.new(0, 0, 0)
  114.     text_button.BorderSizePixel = 0
  115.     text_button.Position = UDim2.new(1, 0, 0.5, 0)
  116.     text_button.Size = UDim2.new(0, 24, 0, 24)
  117.     text_button.Visible = true
  118.     text_button.Parent = frame_3
  119.  
  120.     local uicorner_2 = Instance.new("UICorner")
  121.     uicorner_2.CornerRadius = UDim.new(0, 5)
  122.     uicorner_2.Parent = text_button
  123.  
  124.     local image_button = Instance.new("ImageButton")
  125.     image_button.Image = "rbxassetid://3926305904"
  126.     image_button.ImageColor3 = Color3.new(0.784314, 0.784314, 0.784314)
  127.     image_button.ImageRectOffset = Vector2.new(924, 724)
  128.     image_button.ImageRectSize = Vector2.new(36, 36)
  129.     image_button.AnchorPoint = Vector2.new(0.5, 0.5)
  130.     image_button.BackgroundTransparency = 1
  131.     image_button.LayoutOrder = 3
  132.     image_button.Position = UDim2.new(0.5, 0, 0.5, 0)
  133.     image_button.Size = UDim2.new(0, 18, 0, 18)
  134.     image_button.Visible = true
  135.     image_button.ZIndex = 2
  136.     image_button.Parent = text_button
  137.  
  138.     --Animations
  139.     TS:Create(frame_3, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Position = UDim2.new(0.5, 0, 1, 0) }):Play()
  140.     TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 35) }):Play()
  141.  
  142.     -- Close Button
  143.     local function close_NotificationLibrary()
  144.         TS:Create(image_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { ImageTransparency = 1 }):Play()
  145.         TS:Create(text_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
  146.         TS:Create(text_label, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { TextTransparency = 1 }):Play()
  147.         task.wait(.17)
  148.         TS:Create(frame_3, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
  149.         TS:Create(uistroke, TweenInfo.new(0.24, Enum.EasingStyle.Quint), { Transparency = 1 }):Play()
  150.         task.wait(.05)
  151.         TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 0) }):Play()
  152.         task.wait(.2)
  153.         frame_2:Destroy()
  154.     end
  155.     text_button.MouseEnter:Connect(function()
  156.         TS:Create(text_button, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 0.8 }):Play()
  157.         TS:Create(image_button, TweenInfo.new(0.3, Enum.EasingStyle.Quint),
  158.             { ImageColor3 = Color3.new(0.890196, 0.054902, 0.054902) }):Play()
  159.     end)
  160.  
  161.     text_button.MouseLeave:Connect(function()
  162.         TS:Create(text_button, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
  163.         TS:Create(image_button, TweenInfo.new(0.3, Enum.EasingStyle.Quint),
  164.             { ImageColor3 = Color3.new(0.784314, 0.784314, 0.784314) }):Play()
  165.     end)
  166.  
  167.     text_button.MouseButton1Click:Connect(function()
  168.         TS:Create(image_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { ImageTransparency = 1 }):Play()
  169.         TS:Create(text_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
  170.         TS:Create(text_label, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { TextTransparency = 1 }):Play()
  171.         task.wait(.17)
  172.         TS:Create(frame_3, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
  173.         TS:Create(uistroke, TweenInfo.new(0.24, Enum.EasingStyle.Quint), { Transparency = 1 }):Play()
  174.         task.wait(.05)
  175.         TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 0) }):Play()
  176.         task.wait(.2)
  177.         frame_2:Destroy()
  178.     end)
  179.     image_button.MouseButton1Click:Connect(close_NotificationLibrary)
  180.     task.delay(tonumber(timee) and timee or 10, close_NotificationLibrary)
  181. end
  182.  
  183. return NotificationLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement