Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is roblox returning error 773 "Teleport Failed: Access Restricted"?

Why is roblox returning error 773 "Teleport Failed: Access Restricted" whenever I try to teleport the player to a specific place instance on line 27 of this server script.

local createPrivateServerEvent = game.ReplicatedStorage.CreatePrivateServerEvent
local joinPrivateServerEvent = game.ReplicatedStorage.JoinPrivateServerEvent
local teleportService = game:GetService("TeleportService")
local assetService = game:GetService("AssetService")
local placeId = 2616317634
local dataStoreService = game:GetService("DataStoreService")
local jobIdStore = dataStoreService:GetDataStore("JobIdStore")

createPrivateServerEvent.OnServerEvent:Connect(function(player)
	pcall(function()
		local placeVersion = tostring(game.PlaceVersion)
		assetService:CreatePlaceAsync(player.Name.."'s private server", placeId, "The Private Server Of The User "..player.Name..". Version: "..placeVersion)
		jobIdStore:SetAsync(player, "")
		teleportService:Teleport(placeId, player)
	end)
end)

joinPrivateServerEvent.OnServerEvent:Connect(function(player)
	pcall(function()
		local instanceId = jobIdStore:GetAsync(player)
		local triesLeft = 150
		while instanceId == "" and triesLeft > 0 do
			wait(0.1)
			triesLeft = triesLeft - 1
		end
		print(instanceId)
		teleportService:TeleportToPlaceInstance(placeId, instanceId, player)
	end)
end)

2 comments

0

Is the select place you're trying to teleport the player to, active/public?

0

yes i can teleport them to the same instance right after i create it using "teleportService:Teleport(placeId, player)" without any errors and the place is public, so I have no clue why it isn't working with "teleportService:TeleportToPlaceInstance(placeId, instanceId, player)". I have also checked if it is getting the correct instanceId / jobid and it is.

1 answer

✓ Accepted answer

You checked if the game that will teleport the player is public? If it's private, that error will appear.

This discussion is preserved as it was. New answers, comments, and votes are closed.