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

How to teleport between places but in the same server ?

Asked by 4 years ago
Edited 4 years ago

I want the player to teleport to another place without changing server, so when he return to main place he will find the same players, I found a teleport script but when the player teleport to a place it changes the server so when he return back he returns to a diffiternt server and not to the server that he was in. Can anyone help? This is the scrip I found :

local TeleportService = game:GetService("TeleportService")

local placeID_1 = 408502340

local function onPartTouch(otherPart)
    local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
    if player then
        TeleportService:Teleport(placeID_1, player)
    end
end
script.Parent.Touched:Connect(onPartTouch)
0
You need to use TeleportToPlaceInstance to go to a specific lobby server by ID, and this means the satellite place has to know what lobby the player came from, which can be done with teleport data (easiest and preferred), datastores, messageservice, or your own server solution. See the example here: https://developer.roblox.com/en-us/api-reference/function/TeleportService/TeleportToPlaceInstance EmilyBendsSpace 1025 — 4y
0
how can I use it in my code ? belalg1 9 — 4y

Answer this question