Why is the TeleportPartyAsync not working?

Hey developers,

So I had this script where when a proximity prompt is activated, the whole server gets teleported to ANOTHER place (inside of the same experience) in the same set of players that were in the old server. (if that did not make sense to you just tell me)

But then when I tested it out with my friend it did not work but no errors were produced. Here’s the code:

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

local TARGET_PLACE_ID = 16841498221

local playerList = {}
for _, player in ipairs(Players:GetPlayers()) do
    table.insert(playerList, player.UserId)
end

local success, result = pcall(function()
    return TeleportService:TeleportPartyAsync(TARGET_PLACE_ID, playerList)
end)

if success then
    local jobId = result
    print("Players teleported to", jobId)
else
    warn(result)
end

Thanks for your help! :heart:

Can anyone help me? Please? I need some help!

Can someone just PLEASE help me!!

Roblox recommends you use TeleportAsync instead of any of those other functions because it includes the functionality of all of them

1 Like

Here is the Roblox documentation for teleporting

I tested this, and this is what I did but it did not work and gave me the error: Unable to cast value to Objects

local PlayerList = Players:GetPlayers()
	
TeleportService:TeleportAsync(PlayerList, placeId)


Make sure your parameters are in the right order,

  1. PlaceId

  2. Players

  3. Teleport Options

1 Like

Thank you @wastbo and @sparklenico20 !

1 Like

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