So I started making an Automatic game where it needs 5 people to start. This is the script I have:
if game.Players.NumPlayers > 4 then script.Parent.Text = "5 Players Needed To Start The Trial" wait(2) script.Parent.Text = "Trials Will Begin In 10 Seconds" game.Workspace.Beep.Sound:Play() wait(1)
And so on. So when 5 people come it starts the game and opens the doors and stuff but then if somebody resets it does it all over again. How do I make it so if someone kills their self It doesn't start over again and when 5 people join it starts and then restarts but needs 5 people.
For minigames type games, I suggest doing something like so:
local minimumNumPlayers=5 local numPlayers=game.Players.NumPlayers local gameRunning=false local roundChoices={"minigame1","minigame2","minigame3" } local PlayRound = function(round) local time=180 local tickStartTime=tick() local minigame=game.ServerStorage[round]:clone() minigame.Parent=workspace --or whatever loads your minigame, also load players, give tools, etc. etc. repeat local tickCurrentTime=tick() time=tonumber(time-(tickCurrentTime-tickStartTime)) --add other cool countdown stuff here, idk wait() until --whatever condition makes your minigame ends, you could put a bool value telling if a player is in or out and that changes when they die, flag captured, etc., whatever end while numPlayers>=5 and not gameRunning do local round=roundChoices[math.random(1,#roundChoices)] PlayRound(round) end
not sure that is perfect or would even work I just wrote that to answer this hope it helped.
But my point is you need to loop it somehow, with a while loop most likely.