Error with TeleportPartyAsync

  1. What do you want to achieve? I want every child of a folder to be teleported to another game.

  2. What is the issue? The script errors with: TeleportService:TeleportPartyAsync error: The player[PlayerUserId] with wrong session.

  3. What solutions have you tried so far? I have tried to look up different posts where people had similar errors, but it did not help me.

This is the code I wrote:

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

while wait(20) do -- Every 20 seconds it will execute.
	if #game.Workspace.Elevator1Players:GetChildren() > 0 then
		local Elevator1Players = {}
		for i, v in pairs(game.Workspace.Elevator1Players:GetChildren()) do
			local player = Players:GetPlayerFromCharacter(v)
			table.insert(Elevator1Players, player)
		end
		
		TeleportService:TeleportPartyAsync(PlaceId, Elevator1Players)
	end
end

1 Like

Studio limitation

This service does not work during playtesting in Roblox Studio — To test aspects of your game using it, you must publish the game and play it in the Roblox application.

As the wiki says, it will not work in Studio. Please read the wiki for topics you are unsure on before making a post.

3 Likes

Oh okay, I should have tested it in-game first. Thanks for helping me! :slight_smile: