Aller au contenu

Système de switch


Messages recommandés

Posté(e)

Bonjour, je souhaite faire un système d'échange de position.

Les teams sont set de cette façon :

 

command /swt <player> <text>:
   usage: /swt <joueur> <team>
   description: Permet d'ajouter un joueur à une team définis
   trigger:
       if arg 2 is "red":
           remove arg 1's name from {teams::*}
           add arg 1's name to {teams::red::*}
           send "{@logo} &cTu as été mis dans l'equipe &c&lRouge" to arg 1
           set arg 1 tab name to "&c%arg 1%"
           set arg 1's display name to "&c%arg 1%"
           make console execute command "/nte prefix %arg 1% &c"

       if arg 2 is "blue":
           remove arg 1's name from {teams::red::*}
           add arg 1's name to {teams::blue::*}           
           send "{@logo} &9Tu as été mis dans l'equipe &9&lBleue" to arg 1
           set arg 1 tab name to "&9%arg 1%"
           set arg 1's display name to "&9%arg 1%"
           make console execute command "/nte prefix %arg 1% &9"

 

Une fois que j'ai ajouté les personnes dans les teams je veux échangé une personne de chaque team prise aléatoirement. Une personne de la team bleu va à l'emplacement d'une personne de la team rouge et inversement.

 

command /switch:
   trigger:
       set {_randomred} to a random element out of {teams::red::*}
       set {_locred} to location of {_randomred}
       set {_randomblue} to a random element out of {teams::blue::*}
       set {_locblue} to location of {_randomblue}
       teleport {_randomred} to {_locblue}
       teleport {_randomblue} to {_locred}

Posté(e)

T'es variable "{_randomred}" contien un nom mais skript ne le sait pas

Tu dois donc spécifier que ta variable doit être prise en compte comme un nom

comme ceci :

set {_locred} to location of {_randomred} parsed as player

 teleport {_randomred} parsed as player to {_locblue}

Posté(e)

Après avoir fait les changements ca marche. Mais :

Quand j'ai fais le tout premier switch impec ca marche. Mais après ca me retp au même endroit quand je refais là commande. Et au bout de la 3ème fois que je tape ca marche. Pourquoi et comment réglé.

command /switch:
   trigger:
       set {_randomred} to a random element out of {teams::red::*}
       set {_locred} to location of {_randomred} parsed as player
       set {_randomblue} to a random element out of {teams::blue::*}
       set {_locblue} to location of {_randomblue} parsed as player
       teleport {_randomred} parsed as player to {_locblue}
       teleport {_randomblue} parsed as player to {_locred}

 

Pour essayé de régler le problème en faisant ceci mais rien n'y fait :

command /switch:
   trigger:
       set {_randomred} to a random element out of {teams::red::*}
       set {_locred} to location of {_randomred} parsed as player
       set {_randomblue} to a random element out of {teams::blue::*}
       set {_locblue} to location of {_randomblue} parsed as player
       wait 1 seconds
       teleport {_randomred} parsed as player to {_locblue}
       teleport {_randomblue} parsed as player to {_locred}
       delete {_randomred}
       delete {_randomblue}
       delete {_locred}
       delete {_locblue}

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