1 | local function Type(txt,dur,r,b,g) |
2 | local notificationGui = Instance.new("ScreenGui") |
3 | notificationGui.Name = "CustomNotification" |
4 | notificationGui.Parent = game.CoreGui |
5 | |
6 | local notificationFrame = Instance.new("Frame") |
7 | notificationFrame.Parent = notificationGui |
8 | notificationFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0) |
9 | notificationFrame.Size = UDim2.new(0.5, 0, 0, 50) |
10 | notificationFrame.Position = UDim2.new(0.5, 0, 0.1, 0) |
11 | notificationFrame.AnchorPoint = Vector2.new(0.5, 0) |
12 | |
13 | local UICorner = Instance.new("UICorner", notificationFrame) |
14 | UICorner.CornerRadius = UDim.new(0, 8) |
15 | |
16 | local notificationText = Instance.new("TextLabel") |
17 | notificationText.Parent = notificationFrame |
18 | notificationText.Text = "" |
19 | notificationText.TextColor3 = Color3.fromRGB(r,b,g) |
20 | notificationText.Font = Enum.Font.SciFi |
21 | notificationText.TextSize = 18 |
22 | notificationText.BackgroundTransparency = 1 |
23 | notificationText.Size = UDim2.new(1, 0, 1, 0) |
24 | notificationText.TextWrapped = true |
25 | |
26 | -- L BY L |
27 | local function typeText(label, text, delay) |
28 | for i = 1, #text do |
29 | label.Text = string.sub(text, 1, i) |
30 | wait(delay) |
31 | end |
32 | end |
33 | --type |
34 | coroutine.wrap(function() |
35 | typeText(notificationText, txt, 0.04) |
36 | end)() |
37 | |
38 | wait(#txt * 0.04 + dur) |
39 | notificationGui:Destroy() |
40 | end; |