Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[SOLVED] TextChatService System Message Not Sending?

In my game, I am using text chat service. I am trying to add a leave/join message inside the game. I have made it so that when I join or leave the game, it says I joined or left in a different color, however, when I joined the game, nothing gets sent in the chat. The weird thing is, there are no errors in the output console. This is what I have tried.

SERVER

local remoteEvent = game:GetService("ReplicatedStorage").JoinLeaveRE

game.Players.PlayerAdded:Connect(function(plr)
	if (plr.UserId == 1274540012) then
		remoteEvent:FireAllClients(plr,"[OWNER] "..plr.Name.." joined the game!")
	else
		remoteEvent:FireAllClients(plr,plr.Name.." joined the game.")
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	if (plr.UserId == 1274540012) then
		remoteEvent:FireAllClients(plr,"[OWNER] "..plr.Name.." left the game.")	
	else
		remoteEvent:FireAllClients(plr,plr.Name.." left the game.")
	end
end)

CLIENT

local remoteEvent = game:GetService("ReplicatedStorage").JoinLeaveRE
local chat = game:GetService("TextChatService")
local channel = chat:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")

remoteEvent.OnClientEvent:Connect(function(plr,message)
	channel:DisplaySystemMessage("<font color='#04D9FF'>"..message.."</font>")
	print("PLEASE WORK")
end)

-- #04D9FF

4 comments

0

If your not getting errors usually it has to be an error in the script where the remote event was sent to. Not the one that sends the remote event this is just going by my past experiences with remote events.

0

Hope this helps you find the error. I don't really know much about textchatservice.

0

I checked both the server and the client but they didn't have any errors.

0

Weird

2 answers

Try using RBXSystem instead of RBXGeneral.

Client

local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("JoinLeaveRE")
local chat = game:GetService("TextChatService")
local channel = chat:WaitForChild("TextChannels"):WaitForChild("RBXSystem")

remoteEvent.OnClientEvent:Connect(function(plr,message)
	channel:DisplaySystemMessage("<font color='#04D9FF'>"..message.."</font>")
	print("PLEASE WORK")
end)

-- #04D9FF

3 comments

0

It didn't work.

0

Is TextChatService.CreateDefaultChannels set to true?

0

Yes

I figured it out on my own. I just simply added a task.wait(.5) inside OnClientEvent

1 comment

0

yk you could've just put [SOLVED] in the question title instead of accepting my answer..

This discussion is preserved as it was. New answers, comments, and votes are closed.