How do I use MessagingService to make a global message that every player from every server can see?

im trying to make it so that when i touch a part, a message in the chat shows for every player from every server. it only shows the message for everyone in one server where the part is touched, but not showing up across servers. i’ve tried different arrangements for the code, but all of them have given me the same result.

--Client Script
local cs = game:GetService("CollectionService") 
local rs = game:GetService("ReplicatedStorage")

local delay = 1
local sendMessage = true

for _, v in cs:GetTagged("Completion") do --Get every tagged part
	v.Touched:Connect(function(hit) --If a tagged part is touched
		local hum = hit.Parent:FindFirstChild("Humanoid")
		local char = hum.Parent

		local message = char.Name .. " has completed the " .. v.Name --Message to send in chatbox

		if hum then
			if sendMessage == true then
				
				local chatMessage = game.StarterGui:SetCore("ChatMakeSystemMessage", --This sends a chat in the chatbox, you can customize the chat and what it says
					{
						Text = "[GLOBAL]: " .. message,
						Color = Color3.fromRGB(95, 0, 173),
						Font = Enum.Font.SourceSansBold,
						TextSize = 18
					}
				)
				
				rs.SendMessage:FireServer(chatMessage) --Fire event to server
				
				sendMessage = false 
				task.wait(delay)
				sendMessage = true
			end
		end
	end)
end

--Server Script
local ms = game:GetService("MessagingService")
local cs = game:GetService("CollectionService")
local rs = game:GetService("ReplicatedStorage")

ms:SubscribeAsync("Announcement", function(msg) --Subscribe to topic
	rs.SendMessage.OnServerEvent:Connect(function(player, chatMessage) --Get chat message from local script
		msg.Data = chatMessage --Set data to chat message
		
		ms:PublishAsync("Announcement", chatMessage)
	end)
end)	

also i have posted about this similar problem, but i wanna see if i can get new answers. any help will be greatly appreciated

1 Like

Unfortunately, I believe BasePart.Touched event does not work locally. You’d have to do this script in a server script.

well game.StarterGui:SetCore() only works in local scripts. would i have to make the touched event in the server script, then have another remote event that fires to the local script than do all that messaging stuff?

how would i use ZoneDaemon? i’ve never used something from GitHub since im relatively new

Since “Touched” only works on serverscripts just fireclient() whenever the object is touched.
Fireclient cannot be exploited by exploiters.