Check if a player is in a specific team

  • 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!

CakeOnBake

Member
Oct 4, 2023
1
0
1
Code:
on death:
    if victim is "green":
        broadcast "%{green_team}%"
        remove 1 from {green_team}
        if {green_team} is equal to 0:
            broadcast "green wins"
            end_game()
    
    if victim is "purple":
        broadcast "%{purple_team}%"
        remove 1 from {purple_team}
        if {purple_team} is equal to 0:
            broadcast "purple wins"
            end_game()

I tried using "if victim is <team name>", but it doesn't seem to work,

NOTE: {green/purple_team} are a counter of how many players there are in that team.
NOTE 2: I am using the vanilla team system, no special addons added

I just want to check if a player is in team purple or team green and execute the code accordingly.
 
Last edited by a moderator: