Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
4

how to teleport someone to a different server and reteleport them to the same server?

Asked by
MHaven1 159
8 years ago

so basically i want to know if you can teleport someone to a different server then if they want to come back they can teleport back to the server they teleported from. how can i do that. anything appreciated thank you.

2 answers

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

Continuing with what Inscendio said.

You could use TeleportToPlaceInstance to teleport a player to a specific server of the place.

All you need is the JobID of the server, and the PlaceID for the place.

Example would be you sent a player to a created server of your own, but remember to save the JobID and PlaceID within the TeleportData table, and retrieve them through LocalPlayerArrivedFromTeleport, or you could do it a different way that you would like.

Following links for you to explore LocalPlayerArrivedFromTeleport TeleportToPlaceInstance

Ad
Log in to vote
2
Answered by 8 years ago

To do this, it's very simple. You'll just need the TeleportService.

For example, when the player touches a part, he will be teleported to the other server. The script would be something like this:

local TeleportService = game:GetService("TeleportService")
local level1Id = 408502340

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

script.Parent.Touched:connect(onTouched)

That level1Id you see is the place ID. The place ID will be the place ID of the destination. You can get the place ID from the link of the Roblox website of the game. For example:

https://www.roblox.com/games/432809446/Example-Game

The numbers from the link in bold is the place ID.

0
i know how to teleport someone but am asking how to teleport someone to a different game and if the player wants to teleport back to the game he just teleported from he joins the same server he teleported from at first. MHaven1 159 — 8y
0
^thats not possible RubenKan 3615 — 8y

Answer this question