Repository navigation
Expand file tree
/
Copy pathNotifyLib.lua
More file actions
148 lines (123 loc) · 4.57 KB
/
Copy pathNotifyLib.lua
File metadata and controls
148 lines (123 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
if not _G.Active then _G.Active = {} end
local Module = {}
function Module:Notify(Type, Name, Msg, Duration)
task.spawn(function()
local Colors = if Type == "Error"
then { Color3.fromRGB(255, 74, 84), Color3.fromRGB(255, 46, 58) }
else { Color3.fromRGB(93, 157, 249), Color3.fromRGB(59, 184, 249) }
local NotifGui = game:GetService("CoreGui").RobloxGui:FindFirstChild("NotifGui") or (function()
local Gui = Instance.new("ScreenGui")
Gui.Name = "NotifGui"
Gui.DisplayOrder = 10
Gui.Parent = game:GetService("CoreGui").RobloxGui
return Gui
end)()
if #_G.Active >= 5 then
local Oldest = _G.Active[#_G.Active]
table.remove(_G.Active, #_G.Active)
Oldest:Destroy()
end
local Main = Instance.new("Frame")
local Top = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local TopBar = Instance.new("Frame")
local Message = Instance.new("TextLabel")
local ProgressBar = Instance.new("Frame")
Main.Name = "Main"
Main.Parent = NotifGui
Main.AnchorPoint = Vector2.new(1, 1)
Main.BackgroundColor3 = Color3.fromRGB(21, 21, 21)
Main.BorderSizePixel = 0
Main.Position = UDim2.new(1, 170, 1, -20)
Main.Size = UDim2.new(0, 169.5, 0, 90)
local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 3)
MainCorner.Parent = Main
Top.Name = "Top"
Top.Parent = Main
Top.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Top.BorderSizePixel = 0
Top.Size = UDim2.new(0, 169, 0, 19.5)
local TopCorner = Instance.new("UICorner")
TopCorner.CornerRadius = UDim.new(0, 3)
TopCorner.Parent = Top
local TopGradient = Instance.new("UIGradient")
TopGradient.Color = ColorSequence.new(Colors[1], Colors[2])
TopGradient.Rotation = 0
TopGradient.Parent = Top
Title.Name = "Title"
Title.Parent = Top
Title.BackgroundTransparency = 1
Title.BorderSizePixel = 0
Title.Position = UDim2.new(0.0207100585, 0, 0.102564104, 0)
Title.Size = UDim2.new(0, 162, 0, 15.5)
Title.ZIndex = 3
Title.Font = Enum.Font.Gotham
Title.Text = Name
Title.TextColor3 = Color3.fromRGB(255, 255, 255)
Title.TextSize = 12.5
TopBar.Name = "TopBar"
TopBar.Parent = Main
TopBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
TopBar.BorderSizePixel = 0
TopBar.Position = UDim2.new(0, 0, 0.157894731, 0)
TopBar.Size = UDim2.new(0, 169, 0, 6)
local TopBarGradient = Instance.new("UIGradient")
TopBarGradient.Color = ColorSequence.new(Colors[1], Colors[2])
TopBarGradient.Rotation = 0
TopBarGradient.Parent = TopBar
Message.Name = "Message"
Message.Parent = Main
Message.BackgroundTransparency = 1
Message.BorderSizePixel = 0
Message.Position = UDim2.new(0.0177601501, 0, 0.35, 0)
Message.Size = UDim2.new(0, 162, 0, 40)
Message.ZIndex = 3
Message.Font = Enum.Font.Gotham
Message.Text = Msg
Message.TextColor3 = Color3.fromRGB(255, 255, 255)
Message.TextSize = 11
Message.TextWrapped = true
Message.TextXAlignment = Enum.TextXAlignment.Center
Message.TextYAlignment = Enum.TextYAlignment.Center
ProgressBar.Name = "ProgressBar"
ProgressBar.Parent = Main
ProgressBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
ProgressBar.BorderSizePixel = 0
ProgressBar.Position = UDim2.new(0, 0, 1, -3)
ProgressBar.Size = UDim2.new(0, 0, 0, 3)
local ProgressGradient = Instance.new("UIGradient")
ProgressGradient.Color = ColorSequence.new(Colors[1], Colors[2])
ProgressGradient.Rotation = 0
ProgressGradient.Parent = ProgressBar
table.insert(_G.Active, 1, Main)
for Index, ActiveMain in ipairs(_G.Active) do
game:GetService("TweenService"):Create(ActiveMain, TweenInfo.new(0.2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
Position = UDim2.new(1, -20, 1, -20 - 100 * (Index - 1))
}):Play()
end
game:GetService("TweenService"):Create(ProgressBar, TweenInfo.new(Duration, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {
Size = UDim2.new(1, 0, 0, 3)
}):Play()
task.wait(Duration)
for Index, ActiveMain in ipairs(_G.Active) do
if ActiveMain == Main then
table.remove(_G.Active, Index)
break
end
end
for Index, ActiveMain in ipairs(_G.Active) do
game:GetService("TweenService"):Create(ActiveMain, TweenInfo.new(0.2, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {
Position = UDim2.new(1, -20, 1, -20 - 100 * (Index - 1))
}):Play()
end
local CurrentY = Main.Position.Y.Offset
local TweenOut = game:GetService("TweenService"):Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.In), {
Position = UDim2.new(1, 170, 1, CurrentY)
})
TweenOut:Play()
TweenOut.Completed:Wait()
Main:Destroy()
end)
end
return Module