So i’ve got a problem. I have lobby system, and I’m trying to do it so that when the party leader (p1) presses start all the players of the lobby are teleported to a private server. The lobby system uses folder and value instances in Replicated Storage to achieve this, storing the name of the players. My problem is that when a player hits play it teleports all players in the menu server to the same lv and server
the script is as follows:`
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local TeleportService = game:GetService(“TeleportService”)
local teleportOptions = Instance.new(“TeleportOptions”)
local PlayersToTeleport = {}
ReplicatedStorage.Teleport.OnServerEvent:Connect(function(blablabla, LobbyNr, SelectedLv)
for i, v in pairs(ReplicatedStorage.OccupiedLoobies["lobby"..LobbyNr]:getChildren()) do
if v:IsA("StringValue") and v.Value ~= nil and i <= ReplicatedStorage.OccupiedLoobies["lobby"..LobbyNr]["nrOfPlayer"..LobbyNr].Value then
local Sufix = "p"..i
PlayersToTeleport[Sufix] = game.Players:FindFirstChild(v.Value).Name
print(game.Players:FindFirstChild(v.Value).Name)
end
end
wait(60)
--local reservedServerAccessCode = TeleportService:ReserveServer(SelectedLv)
teleportOptions.ShouldReserveServer = true;
--TeleportService:TeleportToPrivateServer(SelectedLv, reservedServerAccessCode, game.Players:GetChildren(PlayersToTeleport))
TeleportService:TeleportAsync(SelectedLv, game.Players:GetChildren(PlayersToTeleport), teleportOptions)
end)
`