Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chatQue = {}
- local function shuffleUpOld()
- for i, c in pairs(script.Parent:GetChildren()) do
- if c and c.ClassName == "TextLabel" then
- if tonumber(c.Name) then
- c.Name = tonumber(c.Name) + 1
- c:TweenPosition(UDim2.new(0, 0, 0.075 - ((tonumber(c.Name) - 1) * 0.04), 0), "Out", "Linear", 0.1, true)
- end
- end
- end
- end
- local function colorMessage(color, message)
- message.TextColor3 = Color3.fromRGB(color)
- end
- local function printNotification(message)
- print(message)
- end
- local function destroyNotifcation()
- for i,v in pairs(script.Parent:GetChildren()) do
- if v:IsA("TextLabel") and v.Name == "Notification" then
- v:Destroy()
- end
- end
- end
- local function doNotification(message, color)
- local newNotification = script.Notification:Clone()
- newNotification.Text = message
- newNotification.TextColor3 = color
- newNotification.Name = 1
- newNotification.Parent = script.Parent
- newNotification:TweenPosition(UDim2.new(0.299, 0,0.169, 0), "Out", "Linear", 0.1, true)
- wait(0.1)
- spawn(function()
- wait(5)
- newNotification:TweenPosition(UDim2.new(0.299, 0,-2, 0), "Out", "Linear", 0.1, true)
- wait(0.1)
- newNotification:Destroy()
- end)
- end
- game.ReplicatedStorage.Events.SendNotification.OnClientEvent:connect(function(message, color)
- if message and color then
- local uniqueID = string.sub(message, 1, string.len(message)/2) .. (tick() - math.random())
- table.insert(chatQue, #chatQue + 1, uniqueID)
- repeat wait() until chatQue[1] == uniqueID
- shuffleUpOld()
- doNotification(message, color)
- table.remove(chatQue, 1)
- end
- end)
- _G.notifyPlayer = function(message, color)
- spawn(function()
- if message and color then
- local uniqueID = string.sub(message, 1, string.len(message)/2) .. (tick() - math.random())
- table.insert(chatQue, #chatQue + 1, uniqueID)
- repeat wait() until chatQue[1] == uniqueID
- shuffleUpOld()
- doNotification(message, color)
- table.remove(chatQue, 1)
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement