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
Hello buddy!
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:
Check the permissions of the place you are trying to teleport to. Make sure the player has the necessary permissions to teleport.
Check if the place you are trying to teleport to has disabled the “Teleport” feature for the particular client you are using.
Try using another client to teleport.
If the issue persists, try contacting the creator of the place to see if they have any solutions.
Yo dude I hope this helps!
If you found this comment useful, do not forget to mark it as the solution!