How to teleport a player to another "place" or world when touched a part

so im new to this place or world stuffs and my question is, how do i teleport a player to another “place” not location in the same place btw, i mean new world something like thatwhen it touched a part?

24 Likes

You can use TeleportService to teleport players to another game. And you can use CFrames to teleport players to a certain part using HumanoidRootPart when a part is touched.

2 Likes

You can do this easily using teleportation service, make sure to have it enabled in the game settings though!

local part = script.Parent

part.Touched:Connect(function()
game:GetService('TeleportService'):Teleport(placecode here)
end)
40 Likes

ok thank u so much for the help!!

3 Likes

how do i turn on teleportation service?

2 Likes

You have to go on Game Settings, then on Security and turn on Third Party Teleports, else you will get an error notification from roblox that the teleport failed.

5 Likes

mark it as the solution if it had worked!

4 Likes

Sorry for bumping, but how do I make them teleport to a specific spawn on the new place/game?

6 Likes

“Sorry for bumping, but how do I make them teleport to a specific spawn on the new place/game?”


In the place you’re teleporting from:

local TeleportService = game:GetService("TeleportService")
local placeId = 12345678  -- Target place ID

script.Parent.Touched:Connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        local teleportData = {
            targetSpawn = "BlueBase"  -- This is just a name you define
        }
        TeleportService:Teleport(placeId, player, teleportData)
    end
end)

In the place you’re teleporting to:

In a ServerScript under ServerScriptService:

game.Players.PlayerAdded:Connect(function(player)
    local teleportData = player:GetJoinData().TeleportData
    if teleportData and teleportData.targetSpawn then
        -- Find the part or location matching the name
        local spawnLocation = workspace:FindFirstChild(teleportData.targetSpawn)
        if spawnLocation and player.Character then
            player.Character:PivotTo(spawnLocation.CFrame)
        end
    end
end)

Just make sure you have a part (e.g., BlueBase) in the workspace of the target place.

5 Likes