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

Still dont know why my custom chat wont put the message in the frame?

Asked by 3 years ago

I made this: https://scriptinghelpers.org/questions/101600/i-cant-see-the-problem-position-is-not-a-valid-member-of-localscript but maybe it was too chaotic.

This is the function to trigger the Message Event in ReplicatedStorage:

ChatBar.FocusLost:Connect(function(EnterPressed)
    if EnterPressed then
        local Message = ChatBar.Text
        if Message:len() > 0 then
            game.ReplicatedStorage.Message:FireServer(Message)
        else
                if Message:lower() == Message:upper() and Message ~= "" then
                    game.ReplicatedStorage.Message:FireServer(Message)

and here's the function that is supposed to make the GUI:

game.ReplicatedStorage.Message.OnClientEvent:Connect(function(Message)
    local i = Instance.new("TextLabel",Frame)
    i.Size = UDim2.new(1,0,0.1,0)
    i.TextScaled = false
    i.BackgroundTransparency = 1
    i.Font = Enum.Font.SciFi
    i.TextStrokeTransparency = 0
    i.TextColor3 = Color3.new(235,235,233)
    i.Name = "Chat"
    i.Text = Message
    i.TextXAlignment = Enum.TextXAlignment.Left
    i.TextYAlignment = Enum.TextYAlignment.Top
    local t = Frame:GetChildren()
    Frame:ClearAllChildren()
    if #t > 10 then
        table.remove(t,1)
    end
    for c,v in pairs(t) do
        local l = v:Clone()
        l.Position = UDim2.new(0,0, (c-1)*0.1,0)
        l.Parent = Frame
    end
end)

I think it's the MessageEvent not firing but I have no idea why, or maybe its the failure to create the message.

0
I had the same problem a month ago. Zeuxulaz 148 — 3y
0
kay AmIOriginalOrNot 105 — 3y
0
Does it have any errors? User#30567 0 — 3y
0
Can you post the full script User#30567 0 — 3y
View all comments (5 more)
0
Sure AmIOriginalOrNot 105 — 3y
0
also it does not have a error AmIOriginalOrNot 105 — 3y
0
No errors AmIOriginalOrNot 105 — 3y
0
on output AmIOriginalOrNot 105 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

https://scriptinghelpers.org/questions/101600/i-cant-see-the-problem-position-is-not-a-valid-member-of-localscript

Ad

Answer this question