What do you want to achieve? Teleporting The Player to another Place of the same Game, when a RemoteEvent is fired.
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)"
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):
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)