Hello everyone! I recently asked how to make a announcement system with model descriptions. Later on I found out that there is a new api called Messaging Service. Now my question. How do I use it to create a announcement system that syncs over all active servers? Thanks for your help.
first of all you need to be a beta member if you are not heres the link to join it: Beta Program
after you are a beta program member (which will take a while)
you can make a regular script and put this example code in it
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)
sorry for bad indenting btw