You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am attempting to make a global messaging system.
- What is the issue? Include screenshots / videos if possible!
I get no errors but for some reason it doesnt print anything…
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked over the developer hub documentation and it looks fine to me. I also know I need to pcall it but I am going to implement that once I get the basic function done.
local MessagingService = game:GetService("MessagingService")
local Topic = "ShutdownEvent"
MessagingService:SubscribeAsync(Topic, function(message)
print(message.Data)
end)
game.Players.PlayerAdded:Connect(function(player)
wait(1)
MessagingService:PublishAsync(Topic, "jake has entered the game")
end)