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
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