Attempt to teleport to a place that is restricted

Yo Guys, I have a problem (In the title). So the problem is, I have 2 places. A and B. A is the start place. When A teleports to B, its perfectly normal, no hic-cups. Here is the teleport script from A to B.

--make private reserve servers
local TeleportService = game:GetService("TeleportService")
local gameID = 11973353496
local JobID = game.JobId
local ReservedServer = TeleportService:ReserveServer(gameID)
local WhichSpawn = "AP"
	
local teleportData = {
	Data1 = JobID
}
 
function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
		TeleportService:TeleportToPrivateServer(gameID, ReservedServer, {player}, WhichSpawn, teleportData)
    end
end
 
script.Parent.Touched:connect(onTouched)

HOWEVER, When the player wants to teleport from B back to A, it shows with that eror. Is there any fixes??

B teleport to A script:

--make private server reserved servers
local TeleportService = game:GetService("TeleportService")
local gameID = 11973335326
local data = "Nothing"
local WhichSpawn = "AP"

local teleportData = {
	Data1 = data
}
 
function onTouched(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	local PlayerJobID = player:FindFirstChild("MyPersonalJobID")
    if player then
		TeleportService:TeleportToPlaceInstance(gameID, PlayerJobID.Value, player, WhichSpawn, teleportData)
    end
end
 
script.Parent.Touched:connect(onTouched)

Try using TeleportAsync() instead of TeleportToPlaceInstance().

I need to teleport to a specific jobID

You can add it in TeleportOptions.

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