Help With Rejoining Players into a Reserved Servers/VIP Servers

I’m working on a game related to endings that is single player. If a player wants to play with friends, they would have to go into a free VIP server. I’ve made it so that the player has to click a button to rejoin the server, and it works well for public servers… BUT for VIP servers, I made it so that it TPs the player to a reserved server and saves the reserved server’s access code through a datastore with the key being the PrivateServerOwner’s Id.

ex:

    ReservedCode = DataStore:GetAsync(UserId)

When the player attempts to rejoin in a VIP server/reserved server. It gets the access code and attempts to rejoin. I tried bugtesting and prints to see if the codes are accurate and saving. IT IS WORKING! But when I attempt the teleport, it says:

Failed to connect to the Game. (ID = 17: Connection Attempt Failed).

If you are able to, please help with script examples, demonstrations, and breakdowns on what is happening. (I’m not new to coding, I just haven’t done this type of stuff before!)

The error you’ve provided is stating that your internet connection dropped while joining the server / teleporting.

You’ll need to check your own network settings and ensure that nothing is blocking Roblox or restricting it’s network access.

It’d be helpful for me to get more info.

  1. Which method are you using to teleport players and which options are you providing when calling it?
  2. Where do you see this error that you’ve mentioned, in a Roblox popup (like the window that :Kick() manifests) or in the developer console?
  3. Is there any interesting information in the console regarding the teleport error?
  1. The method I’m using is the :TeleportToPrivateServer thing. What do you mean by the options?
  2. It the Roblox Popup.
  3. There aren’t any interesting information, just prints.

The arguments or parameters that you use when calling it. I called it options since the newer method TeleportAsync uses options instead of parameters. What do you provide to the method you’re using at the moment?

TeleportService:TeleportToPrivateServer(???)

I use

{placeId, the reservedcode saved, {the individual player}, nil, the creator of the private server's userid}

EDIT: added a special third thing
Three things that might turn out to be silly:

  • Can you confirm to me that those are separate arguments and not just one table that you’re giving to TeleportToPrivateServer? (excluding the list of players)
  • Could you try setting the fourth argument (that you provide nil for) to an empty string ("")?
  • There’s two things returned when reserving a server, the ID and the code. Confirm you’re using the code and not the ID.

Well, they weren’t actually in tables, and I’ll try that. I’m gonna have to head to bed after that though.

Thank you so much!! It works now!!!

I was testing the game solo, and when I tried the rejoining, it had the same issue. I think it happens the server has no other players. Do you have any suggestions where I can counter my issue?

I wasn’t aware what fix you had implemented, I only see the post saying it works now. What did you change?

The only thing I changed was that the SpawnName property in the Teleport function was changed to an empty string.

You mention it’s different depending on how many players are in. Can you show me how you’re creating the array of players that you pass into the teleport method?