So I am trying to make a lobby which teleports the players who are in a tube into the same server using reserve server. The way I'm trying to do it, and correct me if this is horrid, but I have a remotevent which fires to the client, back to the server, creates a table of all the players and teleports them. This does work but then a new player teleports, he gets put in the same game as the previous players. I do not receive error codes, or any sort of warning.
This is the teleporting script:
local teleportService = game:GetService("TeleportService") local code = teleportService:ReserveServer(6879552528) local teleportPlace = 6879552528 script.Parent.TeleportingEvent.OnServerEvent:Connect(function(player) local Playerr = {} table.insert(Playerr, player) teleportService:TeleportToPrivateServer(teleportPlace,code,Playerr) end)
You said only one player is printed in the print table,
I think you should use an in pairs()
loop to gather all the players and in each in pairs loop fire the RemoteEvent
or RemoteFunction