#Lobby system flow questions. Hub area or Gui menue

1 messages · Page 1 of 1 (latest)

normal basalt
#

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

neon gyro
#

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?

steady python
normal basalt
steady python
#
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

brittle grotto
#

Teleportservice

#

Ah yes

#

Good job you alr found it out

steady python
#

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

steady python
brittle grotto
steady python
#

well you can add on, my code isnt that great anyways

brittle grotto
normal basalt
#

so this would be if i were to go down the hub area with teleporters route

steady python
steady python
normal basalt
#

yeah does arsenal just have it so u have to click join friend on the roblox launcher thing

#

theres no actual party system in that

#

u just have to pray theres a spot open on ur friends team

#

hub area would prob be handy for different maps and gamemodes tho