PlaceId not getting returned from GetPlayerPlaceInstanceAsync

I want to make it so that i can teleport to a specific user.

For some reason it wont return the placeId, it is always empty and it causes my script to error.

friendId is the userid of the friend

Here is the script:

		local success, errorMessage, placeId, jobId = pcall(function()
			return TS:GetPlayerPlaceInstanceAsync(friendId)
		if success then
			print("place = ".. tostring(placeId))
			print("job = ".. tostring(jobId))
			print("success = ".. tostring(success))
			print("msg = ".. tostring(errorMessage))
			TS:TeleportToPlaceInstance(placeId, jobId, plr)
			warn("Unable to teleport, "..errorMessage)
--it don't print the placeId, it is just empty

The placeid will only return if you’re actually able to join the friend from the website as well. Meaning that their Who can join me? privacy settings have to be set to either option which would let you see what game they’re playing and letting you follow them into a game.

This is the reason why some games which have a “friends online” tab in-game only show that they’re Playing a game without any specific game name at times.

I can help with this one! The API reference on this method is actually wrong. I’ve ran into this issue myself earlier this month. Read this post to get up to scratch with how to use the method: TeleportService:GetPlayerInstanceAsync() issue

If any questions arise, I’ll be happy to help!

1 Like

From what i know that should not affect it, i tried joining somebody who had so that everyone could join and i still had the same issue.

That seems right. This method can only determine whether or not someone is in a place within the calling script’s universe as far as I know. (This is also the only existing restriction if I am correct.) Otherwise it will simply throw a HTTP 400 (…) on the primary result. You can use this message to determine if someone is in another game, or someone is not in-game at all seeing as the messages are different, though I see no use case for this.

1 Like