Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local notifications = {}
- local function createNotification(text)
- if #notifications == 3 then
- notifications[1]:Destroy()
- table.remove(notifications, 1)
- end
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(0, 200, 0, 50)
- textLabel.Position = UDim2.new(1, 0, 0.5, -25 * #notifications + 50 * #notifications)
- textLabel.BackgroundColor3 = Color3.new(0, 0, 0)
- textLabel.TextColor3 = Color3.new(1, 1, 1)
- textLabel.Text = text
- textLabel.Parent = screenGui
- table.insert(notifications, textLabel)
- textLabel:TweenPosition(UDim2.new(0.5, -100, textLabel.Position.Y.Scale, textLabel.Position.Y.Offset), "Out","Linear", 0.2, true)
- for i = 1, #notifications - 1 do
- local offset = 50 + 50 * (#notifications - i - 1)
- notifications[i]:TweenPosition(UDim2.new(0.5, -100, notifications[i].Position.Y.Scale, notifications[i].Position.Y.Offset - offset), "Out","Linear", 0.2, true)
- end
- delay(3, function()
- textLabel:TweenPosition(UDim2.new(1, 0, textLabel.Position.Y.Scale, textLabel.Position.Y.Offset), "Out","Linear", 0.2, true, function()
- textLabel:Destroy()
- table.remove(notifications, table.find(notifications, textLabel))
- end)
- end)
- end
- createNotification("1")
- wait(2)
- createNotification("2")
- wait(2)
- createNotification("3")
- wait(2)
- createNotification("4")
- wait(2)
- createNotification("5")
- wait(2)
- createNotification("6")
- wait(2)
- createNotification("7")
- wait(2)
- createNotification("8")
- wait(2)
- createNotification("9")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement