I’m trying to use the TeleportService:TeleportAsync() function to send the player to a reserved server with some data.
local teleportOptions = Instance.new("TeleportOptions")
teleportOptions.ShouldReserveServer = true
teleportOptions:SetTeleportData({
key = "Value",
})
TeleportService:TeleportAsync(game.PlaceId, { player }, teleportOptions)
local joinData = player:GetJoinData()
if joinData then
warn("Join data exists!")
else
warn("No join data!")
end
if joinData and joinData.TeleportData then
warn(joinData.TeleportData.key)
else
warn("No teleport data!")
end
However it seems that in most cases the player does not get sent to a reserved server and instead just back to the server they were originally in (old logs are seen in the console). And whether or not the player does get to a reserved server, there is never any teleport data.
Oddly enough there were 2 times, out of roughly 50 iterations when it seemed to work consistently but every single time I tried to go back I could never get it to work again.
Should these 2 code blocks not always create a unique new server and send the data with the player? Have I misunderstood or overlooked something?