Still dont know why my custom chat wont put the message in the frame?
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:
1 | ChatBar.FocusLost:Connect( function (EnterPressed) |
3 | local Message = ChatBar.Text |
4 | if Message:len() > 0 then |
5 | game.ReplicatedStorage.Message:FireServer(Message) |
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:
01 | game.ReplicatedStorage.Message.OnClientEvent:Connect( function (Message) |
02 | local i = Instance.new( "TextLabel" ,Frame) |
03 | i.Size = UDim 2. new( 1 , 0 , 0.1 , 0 ) |
05 | i.BackgroundTransparency = 1 |
06 | i.Font = Enum.Font.SciFi |
07 | i.TextStrokeTransparency = 0 |
08 | i.TextColor 3 = Color 3. new( 235 , 235 , 233 ) |
11 | i.TextXAlignment = Enum.TextXAlignment.Left |
12 | i.TextYAlignment = Enum.TextYAlignment.Top |
13 | local t = Frame:GetChildren() |
14 | Frame:ClearAllChildren() |
18 | for c,v in pairs (t) do |
20 | l.Position = UDim 2. new( 0 , 0 , (c- 1 )* 0.1 , 0 ) |
I think it's the MessageEvent not firing but I have no idea why, or maybe its the failure to create the message.