Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why doesn't my Psuedo ChatGui work?

Asked by
Asirix 15
10 years ago

Well, followed the wiki, why doesn't it work?

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 == "6" then
                v:Destroy()
            else
                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
                v.Position = v.Position - UDim2.new(0,0,0.175,0)
            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").script.Parent)
            newchatline = Instance.new("TextLabel",v:WaitForChild("PlayerGui").eChat.Base)
            newchatline.Text = player.Name.. ": " ..msg
            newchatline.Size = UDim2.new(1,0,0.15,0)
            newchatline.Position = UDim2.new(0,0,0,0)
            newchatline.Font = "SourceSansBold"
            newchatline.TextColor3 = Color3.new(255,255,255)
            newchatline.TextStrokeTransparency = 0
            newchatline.BackgroundTransparency = .5
            newchatline.BorderSizePixel = 0
            newchatline.FontSize = "Size18"
            newchatline.TextXAlignment = "Center"
            newchatline.TextYAlignment = "Center"
            newchatline.ClipsDescendants = true
            newchatline.Name = "line1"
        end
        UpdateOldLabels(game:GetService("StarterGui").eChat.Base)
        newchatline:Clone().Parent = game:GetService("StarterGui").eChat.Base
    end)
end)

1 answer

Log in to vote
0
Answered by
Exudo 13
10 years ago

What Is the error?

0
Well, it won;t display chat, so. Yeah, that's kind of the point of it. Asirix 15 — 10y
Ad

Answer this question