TeleportSeervice attempted to teleport to restricted place

I don’t know what I am doing wrong, but the TeleportService script below does not allow me to teleport to another place in my experience.

I always get an error code 773 which describes “attempted to teleport to restricted place”.

local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")

script.Parent.Touched:Connect(function(part)
	if part.Name ~= "HumanoidRootPart" then return end
	
	local player = Players:GetPlayerFromCharacter(part.Parent)
	if player == nil then return end
	
	local success, result = pcall(TeleportService.TeleportAsync, TeleportService, 16963996829, {player})
end)

I’ve noticed other people have the same issue, and they always ask the OP to make sure two places are public. How do I make the two places public? I have tried to make the game to become public, and it still doesn’t work.
image

First off, did you test this in studio?
Edit: doubt you’d make a simple mistake like that, my bad.

TeleportService does not work in studio. You have to test the whole thing in a live Roblox game.

And I have discovered the issue. My places were not published, that is the problem, and it isn’t addressed in the Roblox Documentation.

Roblox documentation sucks these days.

1 Like

Can you even access an unpublished game live in the first place?

Which first place? If you are talking about the target place to which I want to teleport, then no. It didn’t work because that place wasn’t published. You have to manually publish the place it seems.

2 Likes

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