Help with reserved teleport

So, I’m trying to make a story game, but, as soon as I try to teleport it says, “attempted to teleport to a place that is restricted.”

NOTE: THIS IS NOT THE WHOLE SCRIPT.

local function teleportPlayers()
    if #list > 0 then
        script.Parent.GuiPart.SurfaceGui.Frame.Status.Text = "TELEPORTING"
        script.Parent.GuiPart.SurfaceGui.Frame.Status.TextColor3 = Color3.new(1,0,0)
        local playersToTeleport = {}
        local teleportTime = 0
        for i=1,#list do
            if game.Players:findFirstChild(list[i]) then
                table.insert(playersToTeleport,game.Players:findFirstChild(list[i]))
                TransitionEvent:FireClient(game.Players:findFirstChild(list[i]))
            else
                table.remove(list,i)    
            end
        end 
        local code = TS:ReserveServer(placeId)
        teleporting = true
        TS:TeleportToPrivateServer(placeId,code,playersToTeleport) —dis is da problem
        repeat wait() until #list <= 0
        script.Parent.GuiPart.SurfaceGui.Frame.Status.Text = "READY"
        script.Parent.GuiPart.SurfaceGui.Frame.Status.TextColor3 = Color3.new(34/255,255/255,20/255)
        teleporting = false
    end
end

Did you create the place in the asset manager?

Well, not really. I just got the id from the asset manager. I made the place with the places tab on game settings.

Does it show you the place you created in the asset manager → Places?

yes, it does

character limit

Can you maybe tell me what you’re storing in the variable “list”?

I am basically storing how many people are in the game lobby.

May I ask why that is a table then?

Can you maybe try printing the “playersToTeleport” and send it in here?

It comes up with my user. Exactly what I want it to do, it’s just that the place is “restricted”

Hello buddy! :cool:
I tested your code, and unfortunately there was an error message specifically saying “Attempted to teleport to a place that is restricted”. It happens when the place you are trying to teleport to has disabled teleport capabilities for the specific client you are using.

To fix this bug, you can try the following steps:

  1. Check the permissions of the place you are trying to teleport to. Make sure the player has the necessary permissions to teleport.
  2. Check if the place you are trying to teleport to has disabled the “Teleport” feature for the particular client you are using.
  3. Try using another client to teleport.
  4. If the issue persists, try contacting the creator of the place to see if they have any solutions.

Yo dude I hope this helps! :happy1:

If you found this comment useful, do not forget to mark it as the solution! :white_check_mark:

This should fix it. Tell me if it doesn’t work and I’ll try to help you further.

1 Like

I HAVE FIGURED OUT WHY IT WAS RESTRICTED! The place was not published. So I couldn’t join,

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