Im trying to make a story game but im getting this error message: teleport to that place is restricted

Sorry For Category but i didin’t knew where to put that.
Im Trying to make game but always when character should teleport i get message:
-Teleport to that place is restricted


My teleport script is:
local TeleportService = game:GetService(“TeleportService”)

local Place = 5937390237

script.Parent.Touched:connect(function(hit)

local player = game.Players:GetPlayerFromCharacter(hit.Parent)

if player then

	TeleportService:Teleport(Place, player)

end

end)

1 Like

Go to your game settings and enable thirdpartyteleports.

Are you trying to teleport to another place in the game, or another game entirely?
If you are trying to teleport to another game, you are going to have to need a game id.

local TeleportService = game:GetService(“TeleportService”)
local gameID = <>

function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
TeleportService:Teleport(gameID, player)
end
end

script.Parent.Touched:connect(onTouched)

If you crash whenever you try to teleport, enable third party teleports becaue that makes your crash for some reason

Edit: Not sure if this helps, let me know if it doesn’t

The error is simply that the game you are trying to teleport to is not somewhere you can go. This might be because the game is set to Group-Only or it’s set to private or it’s paid-access. Also make sure your third-party teleports are enabled.

If the place is your own game, make sure your game is set to Public, it’s free access, not Group-Only.

You can use this code to teleport a user!

local TeleportService = game:GetService("TeleportService")
local RunService = game:GetService("RunService")
local PlaceID = 0000 --Insert PlaceId of the game.
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)

if Player then
TeleportService:Teleport(PlaceID, Player)
RunService.Heartbeat:Wait(1)
end
1 Like

Well When I Touch The Brick It Doesn’t React
If Im Just Stupid, thats because im new to lua

1 Like

Idk bro, i’m also new to lua lol

1 Like