Remote event not firing for some reason?
Asked by
4 years ago Edited 4 years ago
So I was making my own chat and bubble chat system and I tried to use remote event to fire when the player talks. However, the remote event did not fire and it didn't show anything on the server and client. I did try to search on how to fix it but none of these answers seemed to work for me. Feel free to ask any questions.
ServerScriptService script:
01 | game.ReplicatedFirst.ChatMessage.OnServerEvent:Connect( function (p, msg) |
02 | local ChatGUI = p.Character:WaitForChild( "BubbleChatUI" ) |
08 | ChatGUI.Enabled = false |
12 | print ( "Chat message detected." ) |
13 | msg = game:GetService( "Chat" ):FilterStringForBroadcast(msg, p) |
14 | ChatGUI.Enabled = true |
15 | local val = Instance.new( "StringValue" , workspace.chatMessages) |
18 | ChatGUI.MessageLabel.TextLabel.Text = msg |
TextBox localscript:
1 | script.Parent.FocusLost:Connect( function (EnterPressed) |
3 | game.ReplicatedFirst:WaitForChild( "Events" ).ChatMessage:FireServer(script.Parent.Text) |
4 | script.Parent.Text = "" |