TeleportData from :TeleportToPrivateServer() returning nil?

After reading about :TeleportToPrivateServer(), I see that there can be tuple arguements that can be sent over to the place that the players are being sent to:

however, since I am using reserved servers, I’ve hit a snag. Anything I send over returns nil when I use :GetLocalPlayerTeleportData() -

local TeleportService = game:GetService("TeleportService")

local TeleportData = TeleportService:GetLocalPlayerTeleportData()

print(TeleportData)

I have tried this both in a local and server script but both produce nil.

This is what my teleport script looks like:

   local reservedServer = TeleportService:ReserveServer(5850956879)
   TeleportService:TeleportToPrivateServer(5850956879, reservedServer,QueueTable,"Hello Darkness My Old Friend")

(obviously just a test string)
I need this for my game because I want to wait for all the players who teleported to join the game before the game itself actually starts.
If I’m unable to use this, is there anyway I could attempt something like this?

Thanks!

EDIT: I found the issue, It thought I was sending over a spawn location string. However, my other question still stands: How can I make the game wait until all the players have joined? This only sends data to the character and not the game.

2 Likes

I haven’t worked a lot with teleport service, but I’m guessing this could work?

repeat until Character:IsADecendantOf(“workspace”)

This will essentially wait until the player’s character is loaded into the workspace. Not sure how well it would work with teleport service though.

See but the problem with that is that it’s a reserved server, so even if I do that, that character could load in faster than another person’s character therefore starting the game with only that character in mind.