Aller au contenu
  • 0

Combat tag


Question

Posté(e)

Salut, je suis en train de faire un skript pour empêcher les joueurs de se déconnecter en combat. Je sais qu'il en existe déjà un mais j'aimerais savoir pourquoi le miens ne fonctionne pas et si vous pouviez m'aider.

 

Le code :

options:
  combat_time: 15
  tag: &7[&b&l!&7] &7  
  entering_fight: Vous êtes en combat !
  no_longer_in_fight: Vous n'êtes plus en combat !

on damage:
  if damage was caused by attack or poison or thorns or unknown or projectile:
    if {P.%victim%} = {@combat_time}:
      set {P.%victim%} to 0
      send "{@tag}{@entering_fight}" to the victim
    if {P.%victim%} < {@combat_time}:
      set {P.%victim%} to 0
      wait {@combat_time} seconds
      if {P.%victim%} = {@combat_time}:
        send "{@tag}{@no_longer_in_fight}" to the victim
    if {P.%attacker%} = {@combat_time}:
      set {P.%attacker%} to 0
      send "{@tag}{@entering_fight}" to the attacker
    if {P.%attacker%} < {@combat_time}:
      set {P.%attacker%} to 0
      wait {@combat_time} seconds
      if {P.%attacker%} = {@combat_time}:
        send "{@tag}{@no_longer_in_fight}" to the attacker

every second:
 loop all players:
      if {P.%loop-player%} < {@combat_time}:
        set {P.%loop-player%} to {P.%loop-player%} + 1

 

Quand j'utilise uniquement {P} sans le .%attacker% ou le .%victim% le skript marche quand un seul joueur est connecté :

 

options:
  combat_time: 15
  tag: &7[&b&l!&7] &7  
  entering_fight: Vous êtes en combat !
  no_longer_in_fight: Vous n'êtes plus en combat !

on damage:
  if damage was caused by attack or poison or thorns or unknown or projectile:
    if {P} = {@combat_time}:
      set {P} to 0
      send "{@tag}{@entering_fight}" to the attacker and the victim
    if {P} < {@combat_time}:
      set {P} to 0
      wait {@combat_time} seconds
      if {P} = {@combat_time}:
        send "{@tag}{@no_longer_in_fight}" to the attacker and the victim

every second:
  if {P} < {@combat_time}:
    set {P} to {P} + 1

3 réponses à cette question

Messages recommandés

×
×
  • 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.