GetPlayerPlaceInstanceAsync(), TeleportToPlaceInstance() and instance IDs: Having problems working with this

What I’m trying to make is a system that allows player A to fill in the name of player B, such that he can teleport to the instance id of the place player B is in (same universe).

My plan is as follows:

  • Fill in a name, and obtain the userId of this name using GetUserIdFromNameAsync()
  • Use this userid to obtain the instanceid of the instance with GetPlayerPlaceInstanceAsync(). A check is done if indeed the player is located in an instance of the target place using the returned placeid.
  • Finally use this instanceid with TeleportToPlaceInstance() to teleport player A to player B.

The problem is that an HTTP error occurs when trying to call GetPlayerPlaceInstanceAsync(). Specifically:
“HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden))”.

Am I not using the function properly or is this used for something different? (e.g. places made through CreatePlace())
I’m a bit confused on what exactly this instance ID is.

EDIT: Seems one is not allowed to call this through a local script, and has to be done through a server script. This explains the 403 error as one is forbidden to use the client for this.

1 Like

You’re right, the error message is not clear. I’ve filed a bug in our internal system to take care of this.