Error produced using 'GetPlayerPlaceInstanceAsync'

When I run the following code, where a represents a UserId…

the following error message is produced in ‘Play’ mode in studio:
image

It says ‘GetPlayerPlaceInstanceAsync can only be called from the server.’ , however I am calling the function from the server, as you can see.

Then, when I test it in ‘Start’ mode, a different error message is produced:
image

Why are these error messages produced and how can I resolve them?

Play mode is basically just a client simulation where all server stuff is also run on the client.

The local server probably doesn’t work because place creation/teleportation is a bit more …out of the box… than what the local server is built for.
I expect if you tried to teleport the player in a local test you’d get the same error.

You’ll need to test these features in an actual server.

1 Like

Surely this should be supported for studio? If you’re right, it’s going to make testing a lot more difficult.

At the moment I’m not actually teleporting the player, I’m just building a system to check if friends are online/offline and what server they are in.

1 Like

Use a test server.
Play mode is useless for teleportation or FE testing.

Teleportation out of the current place in studio is out of the question. Since the test server isn’t a real Roblox server, it can’t request a server to teleport the player to. pcall() these sort of things.

1 Like