I have made a singleplayer game and i kind of want to make a feature where you can have a chatbox and talk to other players through it. I know that messagingservice is a thing but im not really sure about how it works. If someone could help me understand it a bit more, it would be appreciated!
local messagingService = game:getService("MessagingService")
-- listen for messages sent to "Topic"
messagingService:SubscribeAsync("Topic", function(message)
print(message.Sent, message.Data)
end)
-- send a messages to "Topic"
MessagingService:PublishAsync("Topic", "Hi i'm a message")