Solved İf Victim Player Group

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

    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!

Status
Not open for further replies.

Yaşarhan

Active Member
May 16, 2020
87
6
8
23
Turkey Istanbul
Code:
on death of player:
    if attacker is a player:
        if player's group is "RedTeam":
            if victim player's group is "BlueTeam":
                add 1 to {killtop.player::%attacker%}

As understood from the code, I have trouble controlling the victim player group.
Can you help me. Thanks.
 
Just do victim’s group? Since the victim is also a player.
 
I also recommend checking for permissions instead of player groups, like this

Code:
on death of player:
    if attacker is a player:
        if attacker has permission "RedTeam":
            if victim has permission "BlueTeam":
                add 1 to {killtop.player::%attacker%}

Simply add the permission node "RedTeam" to the group RedTeam, and "BlueTeam" for the group BlueTeam
 
  • Like
Reactions: Yaşarhan
Code:
on death of player:
    if attacker is a player:
        if player's group is "RedTeam":
            if victim player's group is "BlueTeam":
                add 1 to {killtop.player::%attacker%}

As understood from the code, I have trouble controlling the victim player group.
Can you help me. Thanks.
You cant use the expression 'player' in on death event. To check the victim's group try using this:
code_language.skript:
if group of victim is "RedTeam":
 
  • Like
Reactions: Yaşarhan
I also recommend checking for permissions instead of player groups, like this

Code:
on death of player:
    if attacker is a player:
        if attacker has permission "RedTeam":
            if victim has permission "BlueTeam":
                add 1 to {killtop.player::%attacker%}

Simply add the permission node "RedTeam" to the group RedTeam, and "BlueTeam" for the group BlueTeam

RedTeam perms inheritanced BlueTeam that's why I control with groups, sir.
Thank You.
[doublepost=1590430614,1590430318][/doublepost]
You cant use the expression 'player' in on death event. To check the victim's group try using this:
code_language.skript:
if group of victim is "RedTeam":

Thank you sir.
@Viktor Tim Aggerholm
And
@couger44
I used your answers together.

Its working codes:
Code:
on death of player:
    if attacker is a player:
        if group of attacker is "RedTeam":
            if group of victim is "BlueTeam":
                add 1 to {killtop.oyuncu::%attacker%}
        else: #IT STAYS BlueTeam
            if group of victim is "RedTeam":
                add 1 to {killtop.oyuncu::%attacker%}
 
  • Like
Reactions: couger44
Status
Not open for further replies.