Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Notify Lib by me: mr.xrer
- Changelog:
- 25.07.2023:
- - Time argument, autoclose
- - Better animations
- --]]
- local NotificationLibrary = {}
- local CoreGUI = game:GetService("CoreGui")
- local TS = game:GetService("TweenService")
- local HIDEUI = get_hidden_gui or gethui
- if syn and typeof(syn) == "table" and RenderWindow then syn.protect_gui = gethui; end
- local function Hide_UI(gui)
- if HIDEUI then
- gui["Parent"] = HIDEUI()
- elseif (not is_sirhurt_closure) and (syn and syn.protect_gui) then
- syn.protect_gui(gui)
- gui["Parent"] = CoreGUI
- elseif CoreGUI:FindFirstChild('RobloxGui') then
- gui["Parent"] = CoreGUI.RobloxGui
- else
- gui["Parent"] = CoreGUI
- end
- end
- local screen_gui = Instance.new("ScreenGui")
- Hide_UI(screen_gui)
- local frame = Instance.new("Frame")
- frame.AnchorPoint = Vector2.new(0.5, 0.949999988079071)
- frame.BackgroundColor3 = Color3.new(1, 1, 1)
- frame.BackgroundTransparency = 1
- frame.BorderColor3 = Color3.new(0, 0, 0)
- frame.BorderSizePixel = 0
- frame.Position = UDim2.new(0.5, 0, 0.954999983, 0)
- frame.Size = UDim2.new(0, 100, 0, 100)
- frame.Visible = true
- frame.Parent = screen_gui
- local uilist_layout = Instance.new("UIListLayout")
- uilist_layout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- uilist_layout.SortOrder = Enum.SortOrder.LayoutOrder
- uilist_layout.VerticalAlignment = Enum.VerticalAlignment.Bottom
- uilist_layout.Parent = frame
- function NotificationLibrary:SendNotification(mode, text, timee)
- local frame_2 = Instance.new("Frame")
- frame_2.BackgroundColor3 = Color3.new(1, 1, 1)
- frame_2.BorderColor3 = Color3.new(0, 0, 0)
- frame_2.BorderSizePixel = 0
- frame_2.BackgroundTransparency = 1
- frame_2.Size = UDim2.new(0, 100, 0, 0)
- frame_2.Visible = true
- frame_2.Parent = frame
- -- Main Notification Frame
- local frame_3 = Instance.new("Frame")
- frame_3.AnchorPoint = Vector2.new(0.5, 1)
- frame_3.AutomaticSize = Enum.AutomaticSize.X
- frame_3.BackgroundColor3 = Color3.new(0.141176, 0.141176, 0.141176)
- frame_3.BackgroundTransparency = 0.20000000298023224
- frame_3.BorderColor3 = Color3.new(0, 0, 0)
- frame_3.Position = UDim2.new(0.5, 0, 1, 60)
- frame_3.Size = UDim2.new(0, 0, 0, 30)
- frame_3.Visible = true
- frame_3.Parent = frame_2
- local uicorner = Instance.new("UICorner")
- uicorner.CornerRadius = UDim.new(0, 6)
- uicorner.Parent = frame_3
- local uipadding = Instance.new("UIPadding")
- uipadding.PaddingBottom = UDim.new(0, 3)
- uipadding.PaddingLeft = UDim.new(0, 3)
- uipadding.PaddingRight = UDim.new(0, 3)
- uipadding.PaddingTop = UDim.new(0, 3)
- uipadding.Parent = frame_3
- local uistroke = Instance.new("UIStroke")
- uistroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- uistroke.Color = Color3.new(0.0313726, 0.0313726, 0.0313726)
- uistroke.Parent = frame_3
- local text_label = Instance.new("TextLabel")
- text_label.Font = Enum.Font.Gotham
- text_label.Text = mode .. ": " .. text
- text_label.TextColor3 = Color3.new(0.784314, 0.784314, 0.784314)
- text_label.TextSize = 14
- text_label.AutomaticSize = Enum.AutomaticSize.X
- text_label.BackgroundColor3 = Color3.new(1, 1, 1)
- text_label.BackgroundTransparency = 1
- text_label.BorderColor3 = Color3.new(0, 0, 0)
- text_label.BorderSizePixel = 0
- text_label.Size = UDim2.new(0, 0, 0, 24)
- text_label.Visible = true
- text_label.Parent = frame_3
- local uipadding_2 = Instance.new("UIPadding")
- uipadding_2.PaddingLeft = UDim.new(0, 5)
- uipadding_2.PaddingRight = UDim.new(0, 30)
- uipadding_2.Parent = text_label
- local text_button = Instance.new("TextButton")
- text_button.Font = Enum.Font.SourceSans
- text_button.Text = ""
- text_button.TextColor3 = Color3.new(0, 0, 0)
- text_button.TextSize = 14
- text_button.AnchorPoint = Vector2.new(1, 0.5)
- text_button.BackgroundColor3 = Color3.new(0, 0, 0)
- text_button.BackgroundTransparency = 1
- text_button.BorderColor3 = Color3.new(0, 0, 0)
- text_button.BorderSizePixel = 0
- text_button.Position = UDim2.new(1, 0, 0.5, 0)
- text_button.Size = UDim2.new(0, 24, 0, 24)
- text_button.Visible = true
- text_button.Parent = frame_3
- local uicorner_2 = Instance.new("UICorner")
- uicorner_2.CornerRadius = UDim.new(0, 5)
- uicorner_2.Parent = text_button
- local image_button = Instance.new("ImageButton")
- image_button.Image = "rbxassetid://3926305904"
- image_button.ImageColor3 = Color3.new(0.784314, 0.784314, 0.784314)
- image_button.ImageRectOffset = Vector2.new(924, 724)
- image_button.ImageRectSize = Vector2.new(36, 36)
- image_button.AnchorPoint = Vector2.new(0.5, 0.5)
- image_button.BackgroundTransparency = 1
- image_button.LayoutOrder = 3
- image_button.Position = UDim2.new(0.5, 0, 0.5, 0)
- image_button.Size = UDim2.new(0, 18, 0, 18)
- image_button.Visible = true
- image_button.ZIndex = 2
- image_button.Parent = text_button
- --Animations
- TS:Create(frame_3, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Position = UDim2.new(0.5, 0, 1, 0) }):Play()
- TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 35) }):Play()
- -- Close Button
- local function close_NotificationLibrary()
- TS:Create(image_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { ImageTransparency = 1 }):Play()
- TS:Create(text_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
- TS:Create(text_label, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { TextTransparency = 1 }):Play()
- task.wait(.17)
- TS:Create(frame_3, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
- TS:Create(uistroke, TweenInfo.new(0.24, Enum.EasingStyle.Quint), { Transparency = 1 }):Play()
- task.wait(.05)
- TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 0) }):Play()
- task.wait(.2)
- frame_2:Destroy()
- end
- text_button.MouseEnter:Connect(function()
- TS:Create(text_button, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 0.8 }):Play()
- TS:Create(image_button, TweenInfo.new(0.3, Enum.EasingStyle.Quint),
- { ImageColor3 = Color3.new(0.890196, 0.054902, 0.054902) }):Play()
- end)
- text_button.MouseLeave:Connect(function()
- TS:Create(text_button, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
- TS:Create(image_button, TweenInfo.new(0.3, Enum.EasingStyle.Quint),
- { ImageColor3 = Color3.new(0.784314, 0.784314, 0.784314) }):Play()
- end)
- text_button.MouseButton1Click:Connect(function()
- TS:Create(image_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { ImageTransparency = 1 }):Play()
- TS:Create(text_button, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
- TS:Create(text_label, TweenInfo.new(0.15, Enum.EasingStyle.Quint), { TextTransparency = 1 }):Play()
- task.wait(.17)
- TS:Create(frame_3, TweenInfo.new(0.25, Enum.EasingStyle.Quint), { BackgroundTransparency = 1 }):Play()
- TS:Create(uistroke, TweenInfo.new(0.24, Enum.EasingStyle.Quint), { Transparency = 1 }):Play()
- task.wait(.05)
- TS:Create(frame_2, TweenInfo.new(0.2, Enum.EasingStyle.Quint), { Size = UDim2.new(0, 100, 0, 0) }):Play()
- task.wait(.2)
- frame_2:Destroy()
- end)
- image_button.MouseButton1Click:Connect(close_NotificationLibrary)
- task.delay(tonumber(timee) and timee or 10, close_NotificationLibrary)
- end
- return NotificationLibrary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement