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).”
-- 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)
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.