Telelporting players to other place into private server

I would like to teleport players to another place, when other players are in the lobby waiting to be teleported and then they teleport to the same server as other group of players did teleport (to already running server in another place in the game) which is not what I want. I would rather create new server in the place I am going to teleport players to and then after I create new server then I want to teleport them, without teleporting players to already running server/session which makes problem. No one wants to get additional players in the middle of your gameplay.

local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local placeId = 3518496627
local loadingGui = ReplicatedStorage:FindFirstChild("LoadingGui")
local t = game.Players[game.Players.LocalPlayer.Name]:WaitForChild("Teleporting")
wait()
while wait(5) do
     if game.Players[game.Players.LocalPlayer.Name].Teleporting.Value == true then
	    loadingGui.Parent = playerGui
	     TeleportService:SetTeleportGui(loadingGui)
	    TeleportService:Teleport(placeId)
     end
end
5 Likes

I am really sorry if I wrote wrong, I am new here. So sorry if I did something unclear.

So basically, you want a tp system that creates a new server for the new people to join into, and not the existing one people are already in? If so, this makes it much more clearer.

1 Like

Yes, but not in the same place, I want do this but in another place in my game

ReserveServer will create a new server, which will guarantee they will be in a new session.
TeleportToPrivateServer would be used to teleport them into the server.
(These must be done on server)

2 Likes

Not sure what you mean. So you want the teleporter to disable and relocate to a new place, making the old teleporter disabled.?

I tried that, but when I replaced game.PlaceId with the place id I want to teleport to like for example 3517592041 it gives me error

Which error does it give you ?

local TS = game:GetService("TeleportService")
local Players = game:GetService("Players")

local code = TS:ReserveServer(game.PlaceId) -- I tried replace game.PlaceId with 3517592041
local players = Players:GetPlayers() 

TS:TeleportToPrivateServer(game.PlaceId,code,players)-- I tried replace game.PlaceId with 3517592041

Gives me error: 19:29:56.780 - HTTP 0 (HTTP 403 (HTTP 403 (Forbidden)))

From my understanding you shouldn’t be replacing it with anything, you should keep it as game.PlaceId

Then how I can teleport players to the another place without allowing other group of players to join it after words

With the code value and not the game.PlaceId. , I might be wrong, but that’s what I understood from the wikihub page.

Are you testing in studio?

TeleportService wouldn’t work in studio.

You can’t activate it like dss service ?

No, you can only test TeleportService in a live game.

Ah well that’s unfortunate in my opinion.

So let me give you example.

From lobby place, players getting teleported to gameplay place
Then after like 4 minutes another group of players getting teleported to gameplay place and they join already running server which is not what I want, I want them to teleport to gameplay place to the separate server

yeah that’s what this codes do. Creates a new place and teleport the players there

1 Like

But in another place, not in the same place

That is what I said it will always reserve a new blank and empty server to send players.