Place is restricted error when teleporting

My game teleports players to another place inside the same universe and sometimes players are not being teleported. If it were to teleport 40 players, 1 player might get the error that the place is restricted while it works for the others.

I use the exact code from here to teleport players:

I’m not sure what could be causing some players to not be teleported.
Two errors that sometimes pops up, not sure if they have correlation to this issue but:


3 Likes

Try using a pcall and spawn function, and if it gets an error make a repeat wait() until == the error is fixed.

for example:

function teleportfunction()
      local Succes, Error = pcall(function()
            for i, player in (Players) do
                   player:Teleport
            end
      end)

     if Error then
            repeat
            local Succes, Error = pcall(function()
            for i, player in (Players) do
                   player:Teleport
            end
            until Sucess == true 
      end
     end)
end

spawn(teleportfunction)

Something like that.

1 Like

There’s actually a handler for this error, refer to the API Docs! :smiley:

1 Like

I already use that, that is from the article I linked in my post.
None of the errors that I am getting have to do with the place being restricted either so I’m not sure what could be causing that to pop up.

I seem to be running into this issue right now. I’m logging failures to teleport, and it seems as though there’s going to be some individuals that just fail to teleport. I know teleports are handled client-side so if a teleport were to fail then it’d fail because the client experienced an issue while attempting to teleport, usually this behavior is consistent with that player.

2 Likes