Hi, I am trying to fire all clients across all servers using messaging service and it isn’t working. If I try to use it in studio it doesn’t do anything inside of the :SubscribeAsync() function, but if I try to use it when I’m playing the game it will just print out a bunch of tables. What should I do to fix all of this?
game.ReplicatedStorage.DropItem.OnServerEvent:Connect(function(plr, itemPrice, itemName, itemId)
print("recieved serv")
wait(0.5)
local message = itemName
game:GetService("MessagingService"):SubscribeAsync("GlobalAnnouncement", function()
game.ReplicatedStorage.DropItemGlobal:FireAllClients(itemName)
print("working")
local sound = Instance.new("Sound", workspace)
sound.SoundId = "rbxassetid://317044886"
sound:Play()
print("done")
end)
game:GetService("MessagingService"):PublishAsync("GlobalDropitem", message)
print("works")
end)```