How do i get check if only one "playing" player is left?
Asked by
6 years ago Edited 6 years ago
Here a script
01 | local function Start () |
03 | script.Parent.Text = 30 |
09 | script.Parent.Text = script.Parent.Text - 1 |
13 | Workspace.Events.Restart:FireAllClients() |
17 | Workspace.Events.Start.OnServerEvent:Connect(Start) |
Now, what if i want to make the loop to stop if a there are only _ "playing" player is left.
01 | local function Start () |
03 | local players = workspace.NumberOfPlayers.Value |
04 | amount of players currently in the game |
06 | local currently = instance.new( "intvalue" , workspace) |
07 | currently.Name = currently |
08 | currently.Value = NumberOfPlayers.Value |
10 | script.Parent.Text = 30 |
16 | script.Parent.Text = script.Parent.Text - 1 |
18 | if currently = = 1 then break |
22 | Workspace.Events.Restart:FireAllClients() |
26 | Workspace.Events.Start.OnServerEvent:Connect(Start) |
Now how do i make "currently" negate if a player died?