''Attempted to teleport to a place that is restricted'' error

There’s no reason why it shouldn’t work. How to fix?

local Players = game:GetService("Players")
local TeleportService = game:GetService("TeleportService")


local playerToTeleport = Players:GetPlayers()[1]

TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport})

The only think that could possibly be wrong is the TARGET_PLACE_ID variable. x is undefined, so you need to change it to the id of the place you want to teleport to.

I know I wrote x instead because I’m just going to share it on the devforum.

All the scripters I asked say there is no error in the code. I have checked the place id many times it is correct. I can’t open a topic in the bug report category because I’m not a regular member. I do not know what to do.

This is not an issue with needing to enable third party teleports, that error would mean that the game players are being teleported to is not available. “Attempted to teleport to a place that is restricted” means that the target place is either private or not the start place of said game.

I am the owner of this game so whether it is private or not will not cause a mistake. But I tried, made the game public and it still didn’t work. This teleport location is another place of the start place.

Have you tried using TeleportService:Teleport()?

Now fully not working roblox script.

When you create a new place, you have to press the publish to roblox button once.
I finally solved it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.