So, I need to make a lobby system like doors has. For example, I have the lobby place, where players use queue rooms. Now, the thing is, when I teleport them to the main game, how do I close the game so only those players who stood in that room teleport there? Because Im sure if I just teleprt those players they will end up with random players in the actual game. I dont know much in coding and I dont even know if I structured this question correct, but I hope you can help me I guess?
Basically how do I make lobby system like doors has, with server lock, the easiest way to do it
You could basically get all the players in the elevator / teleported whtever and you could then use TeleportService:ReserveServer() to get a code. Then use TeleportServer:TeleportToPrivateServerAsync() (doesn’t actually teleport the players to a private server it’s just a server that can only be joining if you have the same code).
If you’re confused, here’s a code snippet:
-- Countdown is finished and you need to tp those players
-- Idk but you need to get the players in the teleporter
local Code = TeleportService:ReserveServer(placeid)
TeleportService:TeleportToPrivateServerAsync(placeid, code, tableofplayerstotp)
I might be out walking or smthn because I haven’t for a while so I might not be here to respond that fast
Uh, there are diffrenent queues, for example 1 player or 4 or 2 or 3, what I wanted is one place with the maximum limit of 4 people that would lock itself after those players joined, is that possible?
local function teleportPlayers()
if #list > 0 then
billboard.Frame.Status.Text = "TELEPORTING"
billboard.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
local playersToTeleport = {}
local teleportTime = 0
for i=1,#list do
if game.Players:findFirstChild(list[i]) then
table.insert(playersToTeleport,game.Players:findFirstChild(list[i]))
TransitionEvent:FireClient(game.Players:findFirstChild(list[i]))
else
table.remove(list,i)
end
end
local code = TS:ReserveServer(placeId)
teleporting = true
TS:TeleportToPrivateServer(placeId,code,playersToTeleport)
repeat wait() until #list <= 0
billboard.Frame.Status.Text = "READY"
billboard.Frame.Status.TextColor3 = Color3.fromRGB(255, 0, 0)
teleporting = false
end
end