"TeleportService:TeleportPartyAsync error: Must be passed an array of players" Error upon teleporting to another game

Howdy.

I’m currently facing a problem with TeleportService:TeleportPartyAsync where I receive the error in the title of this post.

The script operates after a RemoteEvent is fired, giving the Id of the place they’re being teleported to.

local tpAll = game.ReplicatedStorage.teleportAll
local teleportService = game:GetService("TeleportService")
local players = game.Players:GetPlayers()

tpAll.OnServerEvent:Connect(function(plyr,Id)
	local success, result = pcall(function()
		return teleportService:TeleportPartyAsync(Id,players)
	end)
	
	if success then
		local jobId = result
		print("Players teleported to "..jobId)
	else
		warn(result)
	end
end)

Can somebody please explain why?

EDIT: Yes, I tested it on the actual client. Same output, had a friend in game too.

1 Like

Try moving Players:GetPlayers() inside the RemoteEvent.OnServerEvent because no players may be in the game when the server script loads

2 Likes

That worked, but now it gives me the following message:

Any idea behind that? (Team change message is irrelevant.)

1 Like

That probably means that the place you’re trying to teleport to is from a 3rd party source and/or it’s not part of the starter place

1 Like

That’s strange, I allowed 3rd Party Teleports in settings. (Published and all.) But it doesn’t function.

1 Like

I just re-read the documentation for TeleportService:TeleportPartyAsync() and it seems to only work for places under a starter place

1 Like

I’d assume you mean that I can only teleport from the starter place?
image
Because this isn’t the starter place.

2 Likes

No, it can teleport from other places other than the starter place, just only under the same game (what I’m trying to say is, you can’t teleport to a place outside of the game with TeleportPartyAsync)

1 Like

Oh, so what service should I use for that then?

1 Like

I don’t think there is a proper service for it, the closest thing for it would be TeleportService:Teleport() but it only teleports individual players

1 Like

Alright then, I’ll just do a loop for each individual, thanks.

Edit: It worked, thank you.

2 Likes