How can I make more than one spawn in a lobby system?

Hi! So I’m working on a shooting game that lasts 2 minutes then, it goes back to the lobby. In the script, there is only one in-game spawn and I need at least 4. Any help?

Screenshots of scripts if needed:

image

Instead of teleporting the players to the single spawn, create a folder (or some other organization system) of possible spawn points, and then randomly grab one of those spawns.

3 Likes

It somehow breaks the intermission GUI.

Okay, well can you show the code/error? There’s no reason grabbing a spawn from a folder should break UI unless you did something wrong.

1 Like

Mhm.

Yeah, the error clearly states that GameAreaSpawn is no longer in the Workspace, I’m assuming because you replaced with a folder of spawns. You also didn’t actually implement any logic to grab a random spawn. You need to do something like this:

local gameSpawns = workspace.GameSpawnFolder:GetChildren() -- grab children of spawn folder

local randomSpawn = gameSpawns[math.random(#gameSpawns)] -- choose random spawn
-- teleport player to spawn

Thank you so much, as you can see I’m pretty much starting out in coding.