Aller au contenu
  • 0

Recuper le joueur qui fait tomber un ennemi


Question

Posté(e)

Bonjour,

Comme dit dans le titre, je cherche à savoir comment récupérer la personne qui fait tomber son adversaire. Je m'explique:

Un joueur nommé A tape B.

B tombe

B meurt

add 1 to {test.%uuid of attacker%}

 

Le uuid of attacker ne fonctionne pas dans ce cas puisque B meurt à cause des dégâts de chute.

Par quoi puis-je remplacer uuid of attacker pour que quand un joueur meurt à cause des dégâts de chute causé par un autre joueur ça puisse récupérer cet autre joueur et lui ajouter 1 à une variable par exemple.

 

Si cela manque de clarté dites le moi ;) J'essaierai de mieux m'exprimer.

3 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Avec uuid:

on damage:
   if attacker is a player:
       if attacker is not victim:
           set {test.%uuid of victim%} to "%uuid of attacker%"
on death:
   if attacker is not set:
       if {test.%uuid of victim%} is set:
           loop all players:
               if uuid of loop-player is {test.%uuid of victim%}:
                   add 1 to {test.%uuid of loop-player%}
   else if attacker is set:
       add 1 to {test.%uuid of attacker%}
   delete {test.%uuid of victim%}
on quit:
   delete {test.%uuid of player%}

 

Sans uuid:

on damage:
   if attacker is a player:
       if attacker is not victim:
           set {test.%victim%} to "%attacker%"
on death:
   if attacker is not set:
       if {test.%victim%} is set:
           loop all players:
               if uuid of loop-player is {test.%victim%}:
                   add 1 to {test.%loop-player%}
   else if attacker is set:
       add 1 to {test.%attacker%}
   delete {test.%victim%}
on quit:
   delete {test.%player%}

  • J'aime 1
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.