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

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

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

local TARGET_PLACE_ID = x

local playerToTeleport = Players:GetPlayers()[1]

TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport})

3 Likes

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.

2 Likes

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.

1 Like

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.

1 Like

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.

1 Like

Have you tried using TeleportService:Teleport()?

1 Like

Now fully not working roblox script.

2 Likes

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

24 Likes

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