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?
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.
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)
ok thank u so much for the help!!
how do i turn on teleportation service?
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.
mark it as the solution if it had worked!
Sorry for bumping, but how do I make them teleport to a specific spawn on the new place/game?
“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.