Advertisement
context77

Notification Library

Apr 26th, 2024 (edited)
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.97 KB | None | 0 0
  1. local lib = {}
  2. local table1 = {}
  3. local _SGUI = Instance.new('ScreenGui',game.CoreGui)
  4. _SGUI.Name = 'FE2Notifs'
  5. local TopFrame = Instance.new("Frame")
  6. local TopText = Instance.new("TextLabel")
  7. local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
  8.  
  9. TopFrame.Name = ";3"
  10. TopFrame.Parent = game.CoreGui.FE2Notifs
  11. TopFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  12. TopFrame.BackgroundTransparency = 1
  13. TopFrame.Position = UDim2.new(0.371764719, 0, 0, 0)
  14. TopFrame.Size = UDim2.new(0.255882353, 0, 0.0865671635, 0)
  15.  
  16. UIAspectRatioConstraint.Parent = TopFrame
  17. UIAspectRatioConstraint.AspectRatio = 8.039999961853027
  18.  
  19. function lib.handleAlert(p56, p57, p58, p59)
  20.     if p57.Parent == game.CoreGui.FE2Notifs[';3'] then
  21.         local v48 = (p56 > 4 or p58) and p56 or p56 - 1;
  22.         local v49 = (p56 > 4 or p58) and "In" or "Out";
  23.         if p56 > 4 or p58 then
  24.             p57.ZIndex = 0;
  25.             table.remove(table1, p56);
  26.             local TweenInfo_new_ret13 = TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.In);
  27.             game:GetService("TweenService"):Create(p57.Alert, TweenInfo_new_ret13, {
  28.                 TextTransparency = 1.1,
  29.                 TextStrokeTransparency = 1
  30.             }):Play();
  31.             task.delay(0.3, function()
  32.                 p57:Destroy();
  33.             end);
  34.             return;
  35.         end
  36.         p57:TweenPosition(UDim2.new(0.5, 0, v48, 0), v49, "Sine", 0.325, true);
  37.     end
  38. end
  39.  
  40. function lib.alert(text, clr, tim, special)
  41.     task.spawn(function()
  42.         local _TIME = tim or 4.5;
  43.         local Frame = Instance.new("Frame");
  44.         local TextLabel = Instance.new("TextLabel");
  45.         Frame.Name = "Alert_Frame";
  46.         Frame.Size = UDim2.new(1, 0, 1, 0);
  47.         Frame.Position = UDim2.new(0.5, 0, -1, 0);
  48.         Frame.AnchorPoint = Vector2.new(0.5, 0);
  49.         Frame.BackgroundTransparency = 1;
  50.         local UIScale = Instance.new("UIScale");
  51.         UIScale.Scale = 0;
  52.         UIScale.Parent = Frame;
  53.         TextLabel.Name = "Alert";
  54.         TextLabel.ZIndex = 3;
  55.         TextLabel.Text = text;
  56.         TextLabel.TextColor3 = clr or Color3.new(1, 1, 1);
  57.         TextLabel.TextScaled = true;
  58.         TextLabel.Font = "Ubuntu";
  59.         TextLabel.TextStrokeTransparency = 0;
  60.         TextLabel.BackgroundTransparency = 1;
  61.         TextLabel.BackgroundColor3 = Color3.new();
  62.         TextLabel.BorderSizePixel = 0;
  63.         TextLabel.Size = UDim2.new(1, 0, 1, 0);
  64.         local UIGradient = Instance.new("UIGradient");
  65.         UIGradient.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255), Color3.fromRGB(159, 159, 159));
  66.         UIGradient.Rotation = 90;
  67.         UIGradient.Parent = TextLabel;
  68.         TextLabel.Parent = Frame;
  69.         Frame.Parent = game.CoreGui.FE2Notifs[';3'];
  70.         if _TIME > 8 then
  71.             local Frame2 = Instance.new("Frame", TextLabel);
  72.             Frame2.BorderSizePixel = 0;
  73.             Frame2.BackgroundColor3 = clr or Color3.new(1, 1, 1);
  74.             Frame2.AnchorPoint = Vector2.new(0.5, 0.5);
  75.             Frame2.Position = UDim2.new(0.5);
  76.             Frame2.Size = UDim2.new(1, 0, 0.1, 0);
  77.             Frame2:TweenSize(UDim2.new(0, 0, 0.1, 0), "Out", "Linear", _TIME);
  78.         end
  79.         if special == "rainbow" then
  80.             task.spawn(function()
  81.                 local v85 = 0;
  82.                 while TextLabel and task.wait() do
  83.                     if v85 > 1 then
  84.                         v85 = 0;
  85.                     end
  86.                     TextLabel.TextColor3 = Color3.fromHSV(v85, 1, 1);
  87.                     v85 = v85 + 1 / 120;
  88.                 end
  89.             end);
  90.         end
  91.         local v55 = 1;
  92.         table.insert(table1, v55, Frame);
  93.         for index6 = 1, #table1 do
  94.             lib.handleAlert(index6, table1[index6]);
  95.         end
  96.         local TweenInfo_new_ret14 = TweenInfo.new(0.325, Enum.EasingStyle.Quint, Enum.EasingDirection.Out);
  97.         game:GetService("TweenService"):Create(Frame.UIScale, TweenInfo_new_ret14, {
  98.             Scale = 1
  99.         }):Play();
  100.         game:GetService("TweenService"):Create(TextLabel, TweenInfo_new_ret14, {
  101.             TextTransparency = 0,
  102.             TextStrokeTransparency = 0.1
  103.         }):Play();
  104.         task.wait(_TIME)
  105.         if Frame and TextLabel and TextLabel.TextTransparency <= 0 then
  106.             local v78 = 1;
  107.             for index10 = 1, #table1 do
  108.                 if table1[index10] == Frame then
  109.                     v78 = index10;
  110.                     break;
  111.                 end
  112.             end
  113.             lib.handleAlert(v78, Frame, true, _TIME);
  114.         end
  115.         for index7 = 1, #table1 do
  116.             lib.handleAlert(index7, table1[index7]);
  117.         end
  118.         return TextLabel;
  119.     end)
  120. end
  121.  
  122. return lib
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement