Teleporting a Player doesn't work with Error code

  1. What do you want to achieve? Teleporting The Player to another Place of the same Game, when a RemoteEvent is fired.

  2. What is the issue? If I test it in the Published Roblox Version It gives me an Error Code: "
    Attempt to teleport to a place that is restricted (Code 773)"

  3. What solutions have you tried so far? I Did look at the Devforum already but didn’t find any solutions to my Problem, I did also Try to just do it in one LocalScript, didn’t work.

What I have now is one LocalScript in my UI That Triggers when I click on a TextButton, then it fires a remote-Event and a Server script in the Workspace That runs the Teleport Function when the event is triggered.

Code Server script (Located in game.workspace.AI):

game.ReplicatedStorage.Remoteevents.Teleport.OnServerEvent:Connect(function(player)
	game:GetService("TeleportService"):Teleport(12788635172, player)
end)

Code Local Script (Loacted in StarterGui.Buy.Menu.MainMenu.Play):

script.Parent.MouseButton1Down:Connect(function()
	script.Parent.Visible = false
	script.Parent.Parent.Frame.Visible = true
end)

function ClickChapter1()
	script.Parent.Parent.Frame.Visible = false
	script.Parent.Parent.Parent.Changelog.Frame.Visible = true
	script.Parent.Parent.Parent.Parent.Tutorial.Frame1.Visible = true
end

script.Parent.Parent.Frame.PlayChapter1.MouseButton1Down:Connect(ClickChapter1)

script.Parent.Visible = true

function ClickChapter2()
	local Player = game.Players.LocalPlayer
	script.Parent.Parent.Frame.Visible = false
	game.ReplicatedStorage.Remoteevents.Teleport:FireServer()
end
script.Parent.Parent.Frame.PlayChapter2.MouseButton1Down:Connect(ClickChapter2)

slideworkspace

uislide

Bild_2023-03-15_150314231

Experience is private, set it to public and it might work?

The experience is already Public I did activate Third Partie Teleports As well.

try using :TeleportAsync() instead, the documentations says :Teleport() shouldn’t be used

Tried it now the error doesn’t appear anymore but nothing happens when I click the UI except for obviously going


Visible = false

Here is the code on the doc site. It looks like second param must be a table so put some curlies around player

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

local TARGET_PLACE_ID = 1234 -- replace with your own place ID

local playerToTeleport = Players:GetPlayers()[1] -- get the first user in the experience

TeleportService:TeleportAsync(TARGET_PLACE_ID, {playerToTeleport}, teleportOptions)

Now I get the Error again, I looked into the dev console and it shows this:

In the Server Tab, it doesn’t show anything.

make sure every setting on the other place is set to so you’re allowed to join

But how do I set it the only thing I see when I configure the place is this:

And the main Game is already Public. (Screenshot: that’s the place where you will get teleported to.)

are you sure you’re teleporting to the correct place then? try running this code in the consol in roblox

game:GetService("TeleportService"):TeleportAsync(PlaceID,game.Players:GetPlayers())

and run this in the place you want to teleport to for the place id

print(game.PlaceId)

This should work just fine

I get the error again…

Ignore the Random action it’s from the AI in my game.

Sorry, then i don’t know what could cause, this other then it having something to do with group permissions

I Solved it myself I Forgot to Publish the Place you’re getting teleported to. xd

Yay, self solutions, they are the best.

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