Aller au contenu
  • 0

Téléporter un player sous forme d'argument


Question

Posté(e)

Hello :D

 

J'ai commencer un skript pour mon event mais je rencontre quelques problèmes :

 

- Je n'arrive pas à téléporter un joueurs avec la ligne de code "teleport %arg 2% to {1v1.firstplayer}"

- je veux faire un message personnalisé quand l'argument %arg 2% ou l'argument %arg 3% meurt.

 

Mon code :

 

options:
  1v1: &0[&3&lTournament&0]


command /1v1 [<text>] [<player>] [<player>]:
  permission: 1v1.use
  aliases: vs,1
  trigger:
    #Set les paramèttres de l'arène
    if arg 1 is not set:
      message "{@1v1} &3La commande est &e/1v1 &3help !"
    if arg 1 is "set1":
      set {1v1.firstplayer} to location of player
      message "{@1v1} &3Tu as set le spawn du combattant &en°1"
    if arg 1 is "set2":   
      set {1v1.secondplayer} to location of player
      message "{@1v1} &3Tu as set le spawn du combattant &en°2"
    if arg 1 is "clear1":
      clear {1v1.firstplayer}
      message "{@1v1} &3Tu as clear le spawn du combattant &en°1"
    if arg 1 is "clear2":
      clear {1v1.secondplayer}
      message "{@1v1} &3Tu as clear le spawn du combattant &en°2"


    #Annonce   
    if arg 1 is "annonce":
      broadcast "{@1v1} &3Début de l'évent dans quelques minutes !"
    if arg 1 is "commence":
      broadcast "{@1v1} &3L'évent pvp &ecommence !!"
    if arg 1 is "fin":
      broadcast "{@1v1} &3L'évent pvp est &eterminé !!"


    #Commencer
    if arg 1 is "start":
      arg 2 and arg 3 is set:
        message "{@1v1} &3Le combat &e%arg 2% &3vs &e%arg 3% &3à commencé !"
        teleport %arg 2% to {1v1.firstplayer}
        teleport %arg 3% to {1v1.secondplayer}
        if %arg 2% or %arg 3% die:
          broadcast "{@1v1} &3La manche est gagné par &e%attacker%"

8 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Oups excuse j'ai pas bien lu. Voilà :

 

on death of player:
   set death message to "&b%attacker% &5a tué &b%victim%"

 

Après pour faire 'est mort d'une flèche' et compagnie faut savoir quel a été le dernier dégât mais je sais pas exactement comment m'y prendre :p

  • 0
Posté(e)

oui mais si je veux que soit seulement l'un des deux joueurs qui ont été tp à mon arène (arg 2 et 3) je fais juste on death of arg2 etc .... ?

  • 0
Posté(e)

j'ai trouver donc pas grave merci quand même :D

 

pour les curieux (le code est pas optimisé donc pas taper s'il vous plait :c):

 

        if arg 1 is "ready":
           if arg 2 is not set:
               message "{@1v1} &3La commande est &e/vs ready [joueur] [joueur]"
               stop
           if arg 3 is not set:
               message "{@1v1} &3La commande est &e/vs ready [joueur] [joueur]"
               stop
           if arg 2 is set:
               if arg 3 is set:
                   message "{@1v1} &3Les joueurs sont &eready !"
                   teleport arg 2 to {1v1.firstplayer}
                   clear inventory of the player
                   equip arg 2 with diamond helmet named "{@1v1}"
                   equip arg 2 with diamond chestplate named "{@1v1}"
                   equip arg 2 with diamond leggings named "{@1v1}"
                   equip arg 2 with diamond boots named "{@1v1}"
                   give diamond sword named "{@1v1}" to arg 2
                   give bow named "{@1v1}" to arg 2
                   give 5 enchanted golden apple named "{@1v1}" to arg 2
                   give 64 steak named "{@1v1}" to arg 2
                   give 5 splash potion of healing named "{@1v1}" to arg 2
                   give 1 splash potion of speed named "{@1v1}" to arg 2
                   give 8 splash potion of healing named "{@1v1}" to arg 2
                   give 1 splash potion of strength named "{@1v1}" to arg 2
                   give 8 splash potion of healing named "{@1v1}" to arg 2
                   give 1 splash potion of speed named "{@1v1}" to arg 2
                   give 2 splash potion of healing named "{@1v1}" to arg 2
                   give 64 arrow named "{@1v1}" to arg 2

                   teleport arg 3 to {1v1.secondplayer}
                   clear inventory of the player
                   equip arg 3 with diamond helmet named "{@1v1}"
                   equip arg 3 with diamond chestplate named "{@1v1}"
                   equip arg 3 with diamond leggings named "{@1v1}"
                   equip arg 3 with diamond boots named "{@1v1}"
                   give diamond sword named "{@1v1}" to arg 3
                   give bow named "{@1v1}" to arg 3
                   give 5 enchanted golden apple named "{@1v1}" to arg 3
                   give 64 steak named "{@1v1}" to arg 3
                   give 5 splash potion of healing named "{@1v1}" to arg 3
                   give 1 splash potion of speed named "{@1v1}" to arg 3
                   give 8 splash potion of healing named "{@1v1}" to arg 3
                   give 1 splash potion of strength named "{@1v1}" to arg 3
                   give 8 splash potion of healing named "{@1v1}" to arg 3
                   give 1 splash potion of speed named "{@1v1}" to arg 3
                   give 2 splash potion of healing named "{@1v1}" to arg 3
                   give 64 arrow named "{@1v1}" to arg 3

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