01 | local s = script.Stat |
02 | local vals = game.ReplicatedStorage.vals |
03 | t = 0 |
04 | while true do |
05 | t = 15 |
06 | repeat |
07 | t = t- 1 |
08 | s.Value = "Intermission.. " ..t |
09 | wait( 1 ) |
10 | until t = = 0 |
11 | s.Value = "Game starting!" |
12 | wait( 2 ) |
13 | local mapselect = game.ReplicatedStorage.Games:GetChildren() |
14 | local choose = math.random( 1 ,#mapselect) |
15 | curnum = 0 |
You would have to make a table and then remove them once they have died. Example:
01 | for x, player in pairs (plrs) do |
02 | if player then |
03 |
04 | character = player.Character |
05 |
06 | if not character then |
07 | -- left the game |
08 | table.remove(plrs,x) |
09 | else |
10 | if character:FindFirstChild( "GameTag" ) then |
11 | -- They are still alive |
12 | print (player.Name.. " is still in the game!" ) |
13 | else |
14 | -- They are dead |
15 | table.remove(plrs,x) |
Then You would want to restart so when the player left in the table is <= 1 then you would do (Example):
01 | if #plrs = = 1 then |
02 | -- last person standing |
03 | Status.Value = "The Winner is " ..plrs [ 1 ] .Name |
04 | break |
05 | elseif #plrs = = 0 then |
06 | Status.Value = "Nobody won!" |
07 | break |
08 | elseif i = = 0 then -- This is the time of the match is up (If you have a certain time) |
09 | Status.Value = "Time's up!" |
10 | break |
11 | end |