Unable to teleport to place that is restricted (public place

image
Why is this happening??? code:

server

local Servers = game.ReplicatedStorage:WaitForChild("Servers")
local messagingService = game:GetService("MessagingService")

local PossibleNames = {"Bob", "Guy", "Chad", "Bad", "Good", "Mean", "Smart", "Class", "Bart", "Foom", "Panda", "Fox", "Legend"}

function CheckIfServerAlreadyStored(Id)
	if #Servers:GetChildren() == 0 then 
		return {nil, false}
	else
		for i, v in pairs(game.ReplicatedStorage.Servers:GetChildren()) do
			if v.ServerID == Id then
				return {v, true}
			else
				return {nil, false}
			end
		end
	end
end

messagingService:SubscribeAsync("ServerData", function(playersv, regionv, Idv)
	
	if Idv == game.JobId then else
		
		local newServer = Instance.new("Folder")
		
		if CheckIfServerAlreadyStored(Idv)[2] == true then
			newServer.Name = CheckIfServerAlreadyStored(Idv)[1]
		else
			newServer.Name = PossibleNames[math.random(1, #PossibleNames)]
		end
		
		newServer.Parent = Servers
		
		local region = Instance.new("StringValue")
		local players = Instance.new("NumberValue")
		local Id = Instance.new("NumberValue")
		
		players.Value = playersv
		Id.Value = Idv
		region.Value = "e"
		
		region.Parent = Servers[newServer.Name]
		players.Parent = Servers[newServer.Name]
		Id.Parent = Servers[newServer.Name]
		
		region.Name = "Region"
		players.Name = "Players"
		Id.Name = "ServerID"
		
		
		
		wait(10)
		newServer:Destroy()
	end
	
end)


client

local ServerList = game.ReplicatedStorage:WaitForChild("Servers")
local replicatedStorage = game:GetService("ReplicatedStorage")
local teleportService = game:GetService("TeleportService")

script.Parent.TextButton.MouseButton1Down:Connect(function()
	if script.Parent.TextLabelSelectedServer.Text == "Selected Server: None" then
		teleportService:Teleport(11755651911, game.Players.LocalPlayer)
	else
		teleportService:TeleportToPlaceInstance(11755651911, game.ReplicatedStorage.Servers:WaitForChild(script.Parent.TextLabelSelectedServer.Text).ServerID.Value)
	end
end)

-- Detect new servers
replicatedStorage.Servers.ChildAdded:Connect(function(newServerAdded_)
	local newServerAdded = replicatedStorage:WaitForChild("Template"):Clone()
	newServerAdded.Text = "Players: ".. newServerAdded_:WaitForChild("Players").Value .. ", Region: " .. newServerAdded_:WaitForChild("Region").Value ..  " Name: " .. newServerAdded_.Name
	newServerAdded.Name = newServerAdded_.Name
	newServerAdded.Parent = script.Parent.ServerListScrollingGui
end)

script.Parent.ServerListScrollingGui.ChildAdded:Connect(function(child)
	child.MouseButton1Down:Connect(function()
		script.Parent.TextLabelSelectedServer.Text = child.Name
	end)
end)

ServerList.ChildRemoved:Connect(function(child)
	if script.Parent.ServerListScrollingGui[child.name] then
		script.Parent.ServerListScrollingGui[child.name]:Destroy()
	end
end)

And yes, there is players in the servers, thats just a bug

What Is Error Code 773 In Roblox?

Error code 773 is one of the common errors in Roblox. This error will restrict the players to play the game. It can be either known as Teleport Error or Error Code 773. Teleport error occurs for two reasons:

  • When both the client and the server request to join teleport from the function TeleportService: Teleport. This function may fail and cause the player not to leave the current page.

  • When the player leaves the page due to the server issue it will automatically disconnect the player and request to rejoin again.

How To Fix Roblox Error Code 773?

Try to follow these steps to fix Roblox Error Code 773.

  • Try to Teleport in that arias and games which are not Restricted
  • Try to use a strong VPN to set your location.
  • Teleport Players Individually to Fix Roblox Error Code 773
  • Check If the Game or Places are Under Review

Hope This Helps :slight_smile: