I'm pulling a nonexistent Place ID error even though I'm directly copying it to my clipboard

Hey developers,

I’ve recently tried to incorporate multiple places into a game I’m working on. The following code is inside a server script. In-game an error pops up on-screen saying Error 770: The following place ID does not exist.

The problem is, I directly copied the Place ID onto my clipboard from Studio.

38%20PM

I really don’t know what the issue is. Clearly, it’s user error as it always is with me lol.

local asteroid_place = 3142566937

script.Parent.OnServerEvent:Connect(function(player, place)
if place == “Asteroid” then
game:GetService(“TeleportService”):Teleport(asteroid_place, player)
end
end)

1 Like

Does the error occur when the Teleport method is invoked? As far as I know, this code doesn’t have an issue and the supplied PlaceId is valid.

Using the exact id you put for “asteroid_place”, this is the place I arrive at:

If you can, try to review your code or repro the issue with other games. If the former doesn’t work and you’re able to do the latter, file a bug report.

1 Like

I figured the problem out.

I was using the Teleport function from TeleportService, when I in fact should have been using TeleportToPlaceInstance since that teleports players to other places inside the same game.

1 Like

No, that’s not correct. TeleportToPlaceInstance is used when you want to teleport players to a specific instance (server) in the game, not to subplaces of the game.

Hm… it’s what seems to be working.

What’s the proper function to place the player in a subplace?

You had it right the first time, it was TeleportService:Teleport(PlaceId, Player).

What did your original code look like? You didn’t really post a complete code block so it was hard to determine what the make of your script was. Are asteroid_place and the below remote code in the same script? Have you tried printing the arguments prior to using the Teleport method, reading them and seeing what may have caused the issue?

  • TeleportService/TeleportToPlaceInstance|TeleportToPlaceInstance for teleporting a single Player to a specific server instance in a place that is part of the same game

It might be wrong but it’s working. Using Teleport never worked. And yes atseroid_place is the same I just didn’t know how to place that code inside block code. Didn’t know you had to indent it.