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

How to use Messaging Service?

Asked by 10 days ago

I found a new service called Messaging Service and I looked at it's features and it sounds cool, I tried to use it in my game, but I get this error that I'm not sure what it means.I have http requests enabled!enter image description here

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 FilteredMsg = game:GetService("Chat"):FilterStringForBroadcast(msg, player)

local messageData = {

sender = player.Name,

message = FilteredMsg,

}

local encoded = httpService:JSONEncode(messageData)

messagingService:PublishAsync("Chat", encoded)

end)

end)

messagingService:SubscribeAsync("Chat", callbackFunction)

0
You have to be a beta tester on the DevForum to access MessagingService. RSASDSA 0 — 9d
0
Alright Thanks. SuperSamyGamer 32 — 8d

Answer this question