I want it so if I want to announce something to all the players that are playing my game I can. If you have can you give me a forum from the wiki or dev hub? Also, only one person can do this. So it has perms.
COMMUNITY QUESTION
How to make GlobalAnnoucment System?
1 answer
Try this
-- Global message system
local Players = game:GetService("Players")
local httpService = game:GetService("HttpService")
local messagingService = game:GetService("MessagingService")
function callbackFunction(serviceData)
local decodedData = httpService:JSONDecode(serviceData.data)
print(decodedData.sender.." : "..decodedData.message)
end)
Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(msg)
local messageData = { sender = player.Name, message = msg, -- filter message first! }
local encoded = httpService:JSONEncode(messageData)
messagingService:PublishAsync("Chat", encoded)
end)
end)
messagingService:SubscribeAsync("Chat", callbackFunction)
1 comment
0
How does this work?
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
People use this for most global announcements. https://developer.roblox.com/en-us/api-reference/class/MessagingService
See "Did you attempt to solve it?" https://forum.scriptinghelpers.org/topic/1049/the-question-checklist