How I can check if all players of selected team are dead

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

DragonAce

Member
Jul 12, 2025
2
0
1
Hello guys, I've started researching Skript one week ago and I have some problems that I can't solve
So, what code I have right now
on death:
if {round_active} is true:
if all players where [team of player is "t"] are dead:
broadcast "T team is dead! CT wins!"
add 1 to {ct_score}
execute command "/endround"
else if all players where [team of player is "ct"] are dead:
broadcast CT team is dead! T wins!"
add 1 to {t_score}
execute command "/endround"

And I always recieving this error

[14:12:06 INFO]: Can't understand this effect: else[14:12:06 INFO]:
Line: else if all players where [team of player is "ct"] are dead:

What I can do with this?
P.S: MC version 1.20.1 and latest stable version of Skript - 2.11
 
Last edited:
Code:
on death:
    if {round_active} is true:
        if {blue::*} contains victim:
            remove victim from {blue::*}
            loop all players in {blue::*}:
                set {blueplayers::*} to loop-player
                set {blueplayersleft} to amount of {blueplayers::*}
                if {blueplayersleft} is 0:
                    #end game
        else if {red::*} contains victim:
            remove victim from {red::*}
            loop all players in {red::*}:
                set {redplayers::*} to loop-player
                set {redplayersleft} to amount of {redplayers::*}
                if {redplayersleft} is 0:
                    #end game

This is from my proximity chat skript. Hope it works!
Note: Put your end code at "#endgame"
 
Code:
on death:
    if {round_active} is true:
        if {blue::*} contains victim:
            remove victim from {blue::*}
            loop all players in {blue::*}:
                set {blueplayers::*} to loop-player
                set {blueplayersleft} to amount of {blueplayers::*}
                if {blueplayersleft} is 0:
                    #end game
        else if {red::*} contains victim:
            remove victim from {red::*}
            loop all players in {red::*}:
                set {redplayers::*} to loop-player
                set {redplayersleft} to amount of {redplayers::*}
                if {redplayersleft} is 0:
                    #end game

This is from my proximity chat skript. Hope it works!
Note: Put your end code at "#endgame"
Ty for answer. That seems like interesting way to realise my idea fr! I'm gonna try this solution and give feedback to you :emoji_slight_smile: