Add a way to Tag servers using TeleportService

As a Roblox developer, it is currently too hard to use just one place for multiple purposes, but what do I mean by this?

:grimacing: Currently, I have three places:

  • Lobby: The main place in charge of letting the players edit their character and decide which game option to play.
  • PvP Game: One of the options offered by the lobby for players to play.
  • No-PvP Game: One of the options offered by the lobby for players to play; however, this place automatically removes specific ores, disables PvP, and locks certain areas of the map.

:red_circle: What is the issue with this?

Every time I am willing to make a change to the game I have to edit both places PvP Game and No-PvP Game. In other words, I edit the PvP Game, and then I have to go to the No-PvP Game, delete all, and replace everything with the things in the PvP Game. Yes, both places use the same exact code, yet they act depending on the PlaceId.


:orange_circle: Have you tried anything else?

I have thought about using MemoryStore for me to tag servers; however, what if the other servers start first than what MemoryStore took to save the tag? To fix this issue, I would have to retry and wait for the server to receive its tag and then act according to it.

  • Have in mind that requests could fail and the server will not be re-trying all the time and make the players wait.
  • On the other hand, I would need to retrieve those servers using MemoryStore as well and use messaging service in order to know if that server is full or not to teleport players to existing servers. (Is a whole mess if you think about it and this is the main issue why I am requesting this feature)

Using Player:GetJoinData() could be used for transferring the Tag, yet I do not have a way to retrieve certain servers with those tags and know if I can teleport players to them unless I use really hacky ways.


:green_circle: How would tagging work?

To set a tag, TeleportOptions would offer us a new field called TeleportOptions.ServerTag which is a string, and by default it has a Default value. When teleporting players to that server, that Tag must be present in the server created.

To retrieve the tag from a server, TeleportService would offer us a function called TeleportService:GetServerTag(). This function shouldn’t yield at all and make a request, it should only retrieve the Tag that was given to the server when it was created, in other words, all that data must be present once the server starts. This function returns ‘Default’ if no tag was set.


:smiley: How can this help you?

If Roblox is able to address this issue, it would improve my development experience because I could just use one place to handle everything. I would teleport players to the same place using different tags which would influence how the place would work.

Could other games benefit from this feature as well?

Yes! Imagine games that teleport players to a certain place because:

  • Each place has a different difficulty. (Easy, Medium, Difficult)
  • Start different games and maps, maybe a game like tower defense can benefit from it as well. (Having all maps in the lobby and they teleport the players to a reserved server with a tag indicating the current game play.)

For example:

The Lobby will run the code below when a player wants to play in a No-PvP server. Have in mind that if a server exists with such Tag and the player is able to join it, Roblox should teleport the player to it like they normally do to any server. However, if no server with such a Tag exists, then they should create a new one and teleport the player to the new server with such Tag.

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")

local PlaceId = 0000000
local PlayerList = Players:GetPlayers()
local TeleportOptions = Instance.new("TeleportOptions")
TeleportOptions.ServerTag = "No-PvP"

TeleportService:TeleportAsync(PlaceId, PlayerList, TeleportOptions)

The other place will run this code once the server starts in a Script:

local TeleportService = game:GetService("TeleportService")
if TeleportService:GetServerTag() == "No-PvP" then
      --> Delete.
      --> Disable.
      --> Lock.
      --> Change.
      --> Etc, whatever you wanna do according to that Tag.
end

This way I wouldn’t need to have “hundreds” of places just for one simple task.

Thank you.

7 Likes

Hopefully ROBLOX does add this as a feature. This is EXACTLY why I don’t have multiple places for my games. They’re all in a single game, customization, Non-Pvp zone etc.

2 Likes

as of right now you can send TeleportData of which game mode you want to use and then
use: Player:GetJoinData()

Hello there! In the original post I said this about that method:

Specific Issues:

  • You would have to store every server in MemoryStore and remove them once the servers are not available anymore.
  • Check the number of players in the server you want to teleport them to in case is full.
  • Check if the player has a friend in any of those servers so they can be teleported to it.
  • You will run into issues where other players in other servers will be teleporting to the same server you are teleporting certain players to, causing them to receive the error message of the server being full.
  • With how unreliable TeleportService can be sometimes, imagine it mixed with MemoryStore which could also fail.
  • Worst, I wonder what would happen if a big game like Blox Fruit were to have this system. Would they reach the limits of MemoryStore noting that the limit is under the Experience rather than in the server?

The first four points are a huge issue of why I don’t make such a system. Roblox should add this themselves and is a feature that can help many games indeed.


The GetJoinData method will only work perfectly if the servers are Private or Reserved meaning no one else can join it. Yet, if the servers are public the big issue arrives.

1 Like

yea i fully agree on this feature it would add a lot more flexibility into the systems and even expand on games and make the user experience amazing,

thanks for forwarding about that dnt catch it my bad!

2 Likes