hello fellow robloxians
i am struggling a lot to send a message ive looked for tutorials but they are outdated and dont work , tried the assistant and same outdated scripts, looked through docs but found nothing useful and ive scouted through the forum and this is the best i could find
Your code is fine. The new chat system just takes a moment to initialize. Use task.wait to wait for ~1 second before sending the message. Unfortunately, I do not know of a way to understand when the service is properly ready
replying to SubToParcIeDev_onyt:
the function DisplaSystemMessage only runs client-sided only so it wouldnt work on a server script
replying to Ziffix:
my code wasnt fine but i added wait and it worked just fine like this
wait(2)
game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage("test")
-- feel free to use the script :p
your right i tought i added it in server but that script actualy sended a remote event to the local script
i used it like this
local TCS = game:GetService("TextChatService")
event.OnClientEvent:Connect(function(Masage, channel)
local textChannel
if channel == "Private" then
textChannel = TCS:WaitForChild("TextChannels"):WaitForChild("Private"..player.UserId)
elseif channel == "General" then
textChannel = TCS:WaitForChild("TextChannels"):WaitForChild("RBXGeneral")
end
textChannel:DisplaySystemMessage(Masage)
end)
-- also on the server
local TCS = game:GetService("TextChatService")
local remote =
local plr = game:GetService("Players")
plr.PlayerAdded:Connect(function(player: Player)
task.wait(2)
local privateChannel = Instance.new("TextChannel")
privateChannel.Name = "Private"..player.UserId
privateChannel.Parent = TCS:FindFirstChild("TextChannels")
remote:FireAllClients('<font color="#55ff00">'..player.Name..' have joined the game </font>',"General")
end)
```