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 4 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:

1ChatBar.FocusLost:Connect(function(EnterPressed)
2    if EnterPressed then
3        local Message = ChatBar.Text
4        if Message:len() > 0 then
5            game.ReplicatedStorage.Message:FireServer(Message)
6        else
7                if Message:lower() == Message:upper() and Message ~= "" then
8                    game.ReplicatedStorage.Message:FireServer(Message)

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

01game.ReplicatedStorage.Message.OnClientEvent:Connect(function(Message)
02    local i = Instance.new("TextLabel",Frame)
03    i.Size = UDim2.new(1,0,0.1,0)
04    i.TextScaled = false
05    i.BackgroundTransparency = 1
06    i.Font = Enum.Font.SciFi
07    i.TextStrokeTransparency = 0
08    i.TextColor3 = Color3.new(235,235,233)
09    i.Name = "Chat"
10    i.Text = Message
11    i.TextXAlignment = Enum.TextXAlignment.Left
12    i.TextYAlignment = Enum.TextYAlignment.Top
13    local t = Frame:GetChildren()
14    Frame:ClearAllChildren()
15    if #t > 10 then
View all 23 lines...

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 — 4y
0
kay AmIOriginalOrNot 105 — 4y
0
Does it have any errors? User#30567 0 — 4y
0
Can you post the full script User#30567 0 — 4y
View all comments (5 more)
0
Sure AmIOriginalOrNot 105 — 4y
0
also it does not have a error AmIOriginalOrNot 105 — 4y
0
No errors AmIOriginalOrNot 105 — 4y
0
on output AmIOriginalOrNot 105 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question