Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

(?) Messaging Service subscription to topic is failing

Asked by
chafava -113
4 years ago
Edited 4 years ago

Basically what the script does is that when it subscribes to a topic, it says 'Connected to all severs!' or if failed 'Connection to all servers failed...'. But it will not show either and just forever shows the nothing happened text 'Connection pending...' forever.

local MessagingServive = game:GetService("MessagingService")

local topic = "Mainframe"

local subscribeSuccess, subscribeConnection = pcall(function()
return MessagingServive:SubscribeAsync(topic, function(message)
    print(message.Data)
end)
end)

if subscribeSuccess then
    script.Parent.Text = "Connected to all servers!"
else
    script.Parent.Text = "Connection to all servers failed..."
end

I suck at MessagingService.

Answer this question