Attempted to teleport to a place that is restricted error (error code 773)

Hello Cookie Tech!

I have an error I keep getting when I try to teleport to an place that is in the same universe. When I click the TextButton, it does not teleport me and it gives me the error “Attempted to teleport to a place that is restricted error (error code 773)”, in console it says:

“raiseTeleportInitFailedEvent: Teleport failed because Teleport vailidation failed (Unathorized).”

This is the screenshot of the error:

Here is the script I’m using:

-- Reference to the TextButton
local joinButton = script.Parent

-- Define the place ID you want to teleport to (replace with your own place ID)
local destinationPlaceId = 18472594452 -- Replace with your destination place ID

-- Function to handle the button click event
local function onJoinButtonClicked()
	-- Debug: Button click event
	print("Debug: Join button clicked.")

	-- Debug: Destination place ID
	print("Debug: Attempting to teleport to place ID:", destinationPlaceId)

	-- Attempt to teleport the player to the destination place
	local success, err = pcall(function()
		game:GetService("TeleportService"):Teleport(destinationPlaceId)
	end)

	if success then
		print("Debug: Teleportation initiated successfully.")
	else
		warn("Debug: Teleport failed. Error:", err)

		-- Additional checks to help diagnose the issue
		-- Check if the place ID is valid
		if type(destinationPlaceId) ~= "number" then
			warn("Debug: Invalid place ID. Place ID should be a number.")
		else
			print("Debug: Place ID is valid.")
		end

		-- Check if TeleportService is accessible
		local teleportService = game:GetService("TeleportService")
		if teleportService then
			print("Debug: TeleportService is accessible.")
		else
			warn("Debug: TeleportService is not accessible.")
		end

		-- Check the player's permissions
		local player = game.Players.LocalPlayer
		if player then
			print("Debug: LocalPlayer is valid. Player name:", player.Name)
		else
			warn("Debug: LocalPlayer is not valid.")
		end
	end
end

-- Connect the function to the button's MouseButton1Click event
joinButton.MouseButton1Click:Connect(onJoinButtonClicked)

Have you got HTPPS requests on, and allow third party teleports?

1 Like

Yes, I do.

(20chars)

Do you mind sharing me what the DevConsole says? I feel like I can get a rough idea from that.


The red error, raiseteleport is the error from the teleport

Is the game that you are using:

  • either set to private
  • restricted to a certain rank
  • even published.

If its not any of those things Ill look at the code.

2 Likes

It’s not any of these things, the game is not private, not restricted to certain rank, and it is also published.

Okay, give me five to check this code out- might be longer, ill let you know when I think i’ve found it.

1 Like

Rightyo, I have came to a conclusion.


I looked through your code and found nothing wrong with it at all. So, this made me want to test it. I edited my own place ID, and put it in a LocalScript that is within the TextButton.

I made sure I published it to ROBLOX, then exited studio and joined the game on ROBLOX.

Upon joining, I clicked the button and it teleported me to the game seamlessly.

So, this is what I think:

  • you haven’t enabled HTTPS requests or 3rd party teleports.
  • you arent leaving studio and testing it in the ROBLOX app.
  • the other game has configurations that haven’t been done right (ie. third party teleports, https requests)

Please check these, because this the only thing it can be.

If it still wont work, let me know.

  • So, HTTP Requests and 3rd party teleports are enabled on BOTH games.
  • I tested it in ROBLOX app.
  • The other game haves HTTP requests and 3rd party teleports enabled too.

If you want to test the game yourself, just let me know so I can give you a link.

Yes please, DM it me the link on the forums.

So, I resolved the issue.

What I did is, I replaced the Training Center code with the main-game code and it now teleports the player to the game that is in the universe again.

That’s all I have changed to the code, I didn’t change any other things like HTTP Requests or API Requests or 3rd Party Teleports.

Woo! We solved it! Make sure to mark it as solution, and tell everyone what you changed, @Clonnygamestyu!

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