Teleporting a party using TeleportPartyAsync - Not sure how to teleport them to a reserved server

Does anyone know how would I go about teleporting a group using TeleportService:TeleportPartyAsync() I have tried setting it up like this:

local reserved_ID = teleport_service:ReserveServer(12851837983)
			local teleport_data = {
				placeId = 12851837983,
				jobId = reserved_ID
			}
			teleport_options:SetTeleportData(teleport_data)
			teleport_service:TeleportPartyAsync(12851837983, players_queued, teleport_options)

And this:

            local reserved_ID = teleport_service:ReserveServer(12851837983)
			local teleport_data = {
				placeId = 12851837983,
				jobId = reserved_ID
			}
			teleport_options:SetTeleportData(teleport_data)
			teleport_service:TeleportPartyAsync(12851837983, players_queued, teleport_data)

But neither of these options work. I’ve been trying to find out why and I haven’t found much coverage over TeleportPartyAsync.

  • The error it’s throwing is “Unable to cast value to object”

And this is how I have the players organized:

			local player_table = {}
			table.insert(player_table, player1)
			table.insert(player_table, player2)

Any help would be appreciated, thanks!

2 Likes

Actually ended up solving this- My code on the other script saved the players to the table under player.name rather than player. (It was my own fault)

1 Like

You should be using TeleportAsync for everything.

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