Hello. I have recently been working on a zombie survival game.
It's like one of those games where you enter a "lift" with 1 or more players and then get into another server, where the game actually goes underway.
Since I'm making a zombie survival game, if every person in the server dies, I want the server to shutdown, so they have to go back to the lobby to begin another game.
Any help is greatly appreciated!
If you are using the Teams service to separate the alive players from the dead players, you can use the method GetPlayers
to get a table of all the players on the 'alive' team.
If you are not using the Teams service, you could create a table to track the players that are alive and, whenever a player dies, remove them from that table.
When the table reaches a point where there are no contents inside (indicating that all the players are no longer alive), you can either use the Kick
method on each player or teleport them back to the lobby by using TeleportService
.