hey im just looking for some advice before i script the system for my game loop. I have a map where 4 teams of 4 fight and on round end a new round begins. right now the game starts when the minimum players in the map is met. I do not have a lobby system done. I am wondering if i should go for a hub area in a separate experience or do something like how arsenal does it where you are loaded into a lobby and just have to deploy into the game with a button. my biggest concern is what will happen when someone leaves the game. i need it to fill in a new player to keep the teams even and im not sure how that would be possible with a hub system where players sit in a teleporter que
#Lobby system flow questions. Hub area or Gui menue
1 messages · Page 1 of 1 (latest)
I think you should send them to a different experience and check if any other games are open and how far they've progressed maybe?
in your teleporter you could open a coroutine listener that actively checks if a player is leaving the game, if theyre found in a queue just remove them from the queue table!
lowkey have no idea what this means
let me open up one of my projects to help you visualize
while task.wait() do
repeat task.wait()
script.Parent.Players.TextLabel.Text = tostring(GetPlayersInQueue()).."/"..MaximumPlayers
script.Parent.Timer.TextLabel.Text = "Waiting for "..MinimumPlayers.." players!"
until GetPlayersInQueue() >= MinimumPlayers
for i = 30,0,-1 do
script.Parent.Players.TextLabel.Text = tostring(GetPlayersInQueue()).."/"..MaximumPlayers
script.Parent.Timer.TextLabel.Text = "Teleporting in "..i.." seconds!"
if GetPlayersInQueue() < MinimumPlayers then
break
end
task.wait(1)
end
if GetPlayersInQueue() >= MinimumPlayers then
TeleportAllPlayers()
end
end
game.Players.PlayerRemoving:Connect(function(player)
if PlayersToTeleport[player.Name] then
PlayersToTeleport[player.Name] = nil
end
end)
here is a small snippet of my code
in the final line i confirm
game.Players.PlayerRemoving:Connect(function(player)
if PlayersToTeleport[player.Name] then
PlayersToTeleport[player.Name] = nil
end
end)
if a player is leaving and they're in the queue to teleport we can set them to nil
while in the teleport function
function TeleportAllPlayers()
local players = {}
local ReservedServer = TeleportService:ReserveServer(94129971080307)
for i,v in pairs(PlayersToTeleport) do
if game.Players:FindFirstChild(i) then
table.insert(players, game.Players:FindFirstChild(i))
end
end
TeleportService:TeleportToPrivateServer(94129971080307, ReservedServer, players)
PlayersToTeleport = {}
end
we confirm that game.players can find the player
🥀 fym i've known teleportservice for like ever
I meant you alr helped him out
OH 😭
well you can add on, my code isnt that great anyways
dumbahh
so this would be if i were to go down the hub area with teleporters route
im slow okay 😔
yes, which is one i would prefer if you want reserved parties.
but if you want something like arsenal where anyone can join then you should try a different route