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
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.
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)
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
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