Global Chat Announcements using Cross-Server Messaging

  1. What do you want to achieve? I want a system that when a remote event is fired in a localscript by a player, a global chat announcement across all servers of the game is sent. (In my case: when a player buys a dev. product (donation), a chat message is sent: “Player donated 5 Robux”)

  2. What is the issue? Include screenshots / videos if possible! I can’t find a way to it since I watched YouTube tutorials that were posted months ago and apparently the chat system is different. Plus I can’t find a post on this topic so if it can help people it would be cool!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? I watched tutorials, search in the Cross-Server Messaging Documentation, looked for solutions on the Dev. Hub but didn’t find a solution.

The only script I found (and modified a bit) on a YouTube tutorial was this:
But it only works on old games since “ChatServiceRunner” got replaced by “TextChatService”

local msgService = game:GetService("MessagingService")
local chatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

if not chatService:GetChannel("All") then
	while true do
		local channelThing = chatService.ChannelAdded:Wait()
		if channelThing == "All" then
			break
		end
	end
end

local system = chatService:AddSpeaker("system")
system:JoinChannel("All")

system:SetExtraData("NameColor", Color3.fromRGB(94, 255, 66))
system:SetExtraData("ChatColor", Color3.fromRGB(94, 255, 66))
system:SetExtraData("Font", Enum.Font.FredokaOne)

local tag = {TagText = "System", TagColor = Color3.fromRGB(94, 255, 66)}
system:SetExtraData("Tags", {tag})

msgService:SubscribeAsync("Donation", function(msg)
	local message = msg.Data
	
	system:SayMessage(message, "All")
end)

game.ReplicatedStorage.DonateRemote.OnServerEvent:Connect(function(plr)
	msgService:PublishAsync("Donation", plr.Name.." Donated 5 Robux!")
end)

Thanks if someone has a solution!

Did you at all use MessagingService:SubscribeAsync() to listen for any messages? If so, are you getting any errors in the output? We might need to see the module to assist you further.

The thing is that the script I showed earlier uses ChatServiceRunner but Roblox deleted it from new experiences some months ago and created istead the TextChatService so the only problem in the script above is this… And I’m trying to find a script/solution that doesn’t use ChatServiceRunner.

You could try changing the property in the TextChatService to Legacy. It might make your current code work.

2 Likes

Thank you!! I tested it and it worked! Thanks for helping me! :grin:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.