Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Messaging Service Global Announcements?

Asked by 10 days ago

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.

0
I believe this doesn't apply to your objective, if so then this would be very helpful ROBLOX, but I stick with my statement so you'll have to use the ol' method with .OnUpdate() of the DS-API. Feahren 1576 — 9d

1 answer

Log in to vote
0
Answered by 9 days ago

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

0
please accept answer if you like it mattchew1010_2 -2 — 9d
0
Wait, you need to be in the Beta Program to use Messaging Service? JakyeRU 232 — 9d
0
yes for now Dandystan 702 — 9d
Ad

Answer this question