My custom chat GUI made to resemble the original ROBLOX chat is broken. Everything I type out comes out as gibberish and when I type another thing in it doesn't appear nor does the original line move up.
function UpdateOldLabels(Parent)
for i,v in pairs(Parent:GetChildren()) do
if v.Name:sub(1,4):lower() == "line" then
local LineNumber = v.Name:sub(5)
if LineNumber == "12" then
v:Destroy()
else
v.Name = "line"..tostring(tonumber(LineNumber) + 1)
v.Position = v.Position - UDim2.new(0,0,0,15)
end
end
end
end
game:getService("Players").PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
for _,v in ipairs(game:GetService("Players"):GetChildren()) do
UpdateOldLabels(v:WaitForChild("PlayerGui").ScreenGui.Frame)
newchatline = Instance.new("TextLabel",v:WaitForChild("PlayerGui").ScreenGui.Frame)
newchatline.Text = player.Name.. ": " ..msg
newchatline.Size = UDim2.new(1,0,0,15)
newchatline.Position = UDim2.new(0,0,1,-15)
newchatline.Font = "Arial"
newchatline.TextColor3 = Color3.new(1,1,1)
newchatline.TextStrokeTransparency = 0
newchatline.BackgroundTransparency = 0.4
newchatline.BorderSizePixel = 0
newchatline.FontSize = "Size10"
newchatline.TextXAlignment = "Left"
newchatline.TextYAlignment = "Top"
newchatline.ClipsDescendants = true
newchatline.Name = "line1"
end
UpdateOldLabels(game:GetService("StarterGui").ScreenGui.Frame)
newchatline:Clone().Parent = game:GetService("StarterGui").ScreenGui.Frame
end)
end)
Also, does anyone know if it's possible to make the names a separate color and add a semicolon (";") at the end of the name?

4 comments
You didn't really answer my question, but thanks.
Well thats what you asked for...
Sort of. I didn't need the tag, I only needed a semicolon after the name, and the color didn't work. On the bright side, you DID fix the moving up, the deleting, and the gibberish. :D Thanks.
I just got -2 D: Your welcome