I want to learn more about the courier service

I’ve been planning how I’m going to do my search for a player available to reserve a server in another game in the same universe. but I need the search to be favorable and that is why I must use the courier service. but how should i use it?
The question that I always ask myself and ask in the forum but someone comes along who thinks I’m a professional and explains me in a technical way in the sense that they think I know a lot about the courier service…

What I want is that when the player presses a button, he sends a message to all possible servers but regulated so as not to exploit the messaging service and that when a server receives it and at the same time this other player from that server is sending it. a server is reserved for them in another game so they can fight and that.

In addition: I would also like to know how I would do it with several players (many)

the truth and researched a lot but nothing is associated with what I want

Hello! Are you talking about Messaging service? As it seems like you want to send a global message between servers. I recommend reading up on the Messaging Service API Roblox Messaging Service Docs

That is what I was referring to. I already saw the documentation but it is not very useful. Could you explain more or less how I would do it?

You’d do something like

--script 1
local messageService = game:GetService("MessagingService")

local topic = "example"
local success, failure = pcall(function() messageService:PublishAsync(topic, "This is a test") end)

if not success then
    warn(failure)
end

--script 2
local messageService = game:GetService("MessagingService")

messageService:SubscribeAsync("example", function(message)
    print(message.Data) -- It returns a table and Data is the data we sent to the server
    print(message.Sent) -- The time our message was sent (uses Unix time)
end
2 Likes

Thank you very much and sorry, how would you verify that you received it in order to reserve a server for two or more players?

SubscribeAsync(), as it runs when it receives a message from PublishAsync(); You want the topics to match since thats how roblox knows which SubstribeAsync() function is run

1 Like

In addition, and it will be that you should send the name of the player and the parameter that is ready to reserve a server and that when you receive the name, send them to another game in the same universe and that no one else can join

You would mostlikely want to do some research on ReservedServers

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.