So I'm making a survival horror game and I need it so it can somehow know if a player has escaped to a player being killed. The script checking if there are no players in a team is below. Please help!
if #teamplayers == 0 then for _, v in pairs(game.Players:GetChildren()) do if v.TeamColor == BrickColor.new("Carnation pink") then v.leaderstats.Cash.Value = v.leaderstats.Cash.Value + 100 v.CharacterAppearanceId = v.UserId v.TeamColor = BrickColor.new("White") v.CharacterAppearanceId = v.UserId print("eeeee") game.ReplicatedStorage.ESallyhasWon:FireAllClients() wait(3) script.CountDown.Value = 0 end end end