So I already have a script in my game that changes a players team the minute they die. So, say if all the players on a team have died, then the team is empty. I want to make it so that I can have a script that will only run after an entire team has died. However, I have a Neutral team as well, which will be empty when the round starts, so that one cant be included in the conditions to have it run.
Insert a number value into the workspace. Set it at 0 to start off with and name it "TeamPlrz" (Or whatever else you want). Insert a script to do whatever you want and put this:
if game.Workspace.TeamPlrz.Value==0 then --Put the rest of script here-- end
Now put this LOCALscript into the PlayerGui.
local Plr=game.Players.LocalPlayer function Change(Color) if Color=="" then --Insert the team color that you want to be empty to start the script. game.Workspace.TeamPlrz.Value=game.Workspace.TeamPlrz.Value+1 elseif Color=="" then --Insert the team color that you want players to be in when the script starts. game.Workspace.TeamPlrz.Value=game.Workspace.TeamPlrz.Value-1 end function Left(Player) if Player.TeamColor=="" then --Insert the team color that you want to be empty to start the script. game.Workspace.TeamPlrz.Value=game.Workspace.TeamPlrz.Value-1 end game.Players.PlayerRemoving:connect(Left) Plr.Changed:connect(Change)
Now if you've done this correctly, then it should work. Comment if there's any problems.