(help) No friendlyfire whit permissions

Discussion in 'Skript' started by PhobosARG, Mar 24, 2020.

  1. Hello, I am trying to build teams with permissions (if 2 players have a specific permission, they cannot be damaged, but if one of the 2 players does not have it, they can be damaged).​

    My problem is that I put together two teams and no one can be damaged, not even those without the same permission.
    How should I configure it for those with the same permission not to be damaged, but those with different permission can be damaged?​
     
  2. Code (Text):
    on damage of player:
      attacker is a player
      attacker has permission "nodamage"
      victim has permission "nodamage"
      cancel event
     
  3. Please close the thread if your question has been answered.
     
  4. That does not solve it since, being 2 teams, some player always has one of the two permissions and cancels the event anyway.
    but I already found the solution. Build teams and fix it.
    thanks

    yes
     
  5. esta fue la solucion:

    Code (Text):
    command /equipobra <text>:
        trigger:
            if arg-1 is "bra":
                if {teams::status::solo::%player%} is true:
                    set {teams::status::solo::%player%} to false
                    set {teams::Bra::%player%} to arg-1
                    set {teams::Bra::%arg-1%} to player
                    send "&7You joined a &4Bravellyr" to player

    command /equipomyr <text>:
        trigger:
            if arg-1 is "myr":
                if {teams::status::solo::%player%} is true:
                    set {teams::status::solo::%player%} to false
                    set {teams::Myr::%player%} to arg-1
                    set {teams::Myr::%arg-1%} to player
                    send "&7You joined a &1Myrkvioor" to player

    on damage of player:
        attacker is a player
        victim is a player
        if {teams::Myr::%victim%} is {teams::Myr::%attacker%}:
            cancel event
            send "No puedes pegarle a uno de tu misma ciudad" to attacker
           
    on damage of player:
        attacker is a player
        victim is a player
        if {teams::Bra::%victim%} is {teams::Bra::%attacker%}:
            cancel event      
            send "No puedes pegarle a uno de tu misma ciudad" to attacker

    on death of player:
        add 1 diamond to attacker
        send "&8Obtuviste un &4Corazon &8de un enemigo" to attacker
           
    on join:
        if {teams::status::solo::%player%} is not set:
            set {teams::status::solo::%player%} to true
     
  6. gracias amigo/amiga (no hablo espanol)