Code sample and return list for GetPlayerPlaceInstanceAsync are broken

For the page:
https://developer.roblox.com/en-us/api-reference/function/TeleportService/GetPlayerPlaceInstanceAsync

(..)
		local success, errorMessage, placeId, jobId = pcall(function()
			return TeleportService:GetPlayerPlaceInstanceAsync(followId)
		end)
(..)

This code shouldn’t work I believe, and the parameter list is missing a value. This API returns 4 values outside of a pcall, and should return 5 with a pcall around it (due to the extra bool from the pcall).

Please refer to this post for more info:

Here’s code from a 2+ year old game of mine which works as expected:

...
local success, _, _, placeId, jobId = pcall(function()
	return TeleportService:GetPlayerPlaceInstanceAsync(userId)
end)
if success and placeId then
   ...

The return list and code sample should be amended to use all 5 return values outside of the pcall.

8 Likes

Side-note: I think Developer Hub editors should probably have some sort of manual/automated testing step for the code samples they write, this prevents editing issues like this (which are easily made with quirky API signatures like this, I had to do a double-take here myself to see the issue).

7 Likes