Aller au contenu
  • 0

[Liste] Blocus


Question

Posté(e)

Je me trouve actuellement bloqué pour mon skript

 

J'ai un système pour ajouter des boites, que j'ajoute dans une liste après.

add message to {boites::*}

J'ai fais en sorte de pouvoir les supprimer.

remove arg 2 from {boites::*}

 

Le problème étant que j'ai tenté de créer une liste pour les items pour chacune des boites

add player's tool to {itemlist.%arg 2%::*}

L'argument deux ici est la boîte mais le problème c'est que si j'ai par exemple 2 boîtes cela ajoute les items dans les deux boîtes hors je voudrais que cela ajoute l'item que dans une boite.

add player's tool to {itemlist.Boite1::*}
add player's tool to {itemlist.Boite2::*}

Selon moi il y a une difference ici pourtant si j'utilise %arg 2% ca ajoute dans toutes les boîtes.

 

[spoiler=Tout le code]

options:

   boitemax: 17

   item1: book

   item2: compass

   item3: paper
command /box [<text>] [<text>]:
   permission: box.history
   permission message: &9Box] &bSeul les administrateurs peuvent modifier ceci.
   trigger:
       if arg 1 is not set:
           if arg 2 is not set:
               open chest with 3 rows named "&cGestion des boites" to player
               wait 3 ticks
               format slot 10 of player with {@item1} named "&aListes des boites" to run [make player execute command "/box list"]
               format slot 13 of player with {@item2} named "&aOptions" to run [make player execute command "/box options"]
       else if arg 1 is "list":
           if arg 2 is not set:
               set {_slot} to 0
               loop 27 times:
                   unformat slot {_slot} of player
                   format slot {_slot} of player with air to be unstealable
                   add 1 to {_slot}
               format slot 0 of player with paper named "&9Compteur: &b%{boxcount}%" to be unstealable
               set {_slot} to 1
               loop {boites::*}:
                   set {_loop} to loop-value
                   unformat slot {_slot} of player
                   if {compteur.item%{_loop}%} is not set:
                       set {compteur.item%{_loop}%} to 0
                   format slot {_slot} of player with chest named "&9Nom: &b%{_loop}%" with lore "&9Items: &b%{compteur.item%{_loop}%}%" to run [make player execute command "/box list %{_loop}%"]
                   add 1 to {_slot}
               format slot 26 of player with rose red named "&cRetour arriere" to run [make player execute command "/box"]
           if arg 2 is set:
               set {_slot} to 0
               if {compteur.%arg 2%} is not set:
                   set {compteur.%arg 2%} to 0
               loop 27 times:
                   unformat slot {_slot} of player
                   format slot {_slot} of player with air to be unstealable
                   add 1 to {_slot}
               format slot 0 of player with paper named "&9Compteur: &b%{compteur.%arg 2%}%" to be unstealable
               set {_slot} to 1
               loop {boite.%arg 2%::*}:
                   set {loop} to loop-value
                   unformat slot {_slot} of player
                   if {compteur.item%{_loop}%} is not set:
                       set {compteur.item%{loop}%} to 0
                   format slot {_slot} of player with {loop} named "&9Item: &b%{loop}%" to be unstealable
                   add 1 to {_slot}
               format slot 26 of player with rose red named "&cRetour arriere" to run [make player execute command "/box list"]
       else if arg 1 is "options":
           if arg 2 is not set:
               set {_slot} to 0
               loop 27 times:
                   unformat slot {_slot} of player
                   format slot {_slot} of player with air to be unstealable
                   add 1 to {_slot}
               format slot 0 of player with green wool named "&aAjouter une boite" to close then run [make player execute command "/box create"]
               format slot 1 of player with red wool named "&cRetirer une boite" to run [make player execute command "/box remove"]
               format slot 2 of player with yellow wool named "&eAjouter item" to close then run [make player execute command "/box additem"]
               format slot 26 of player with rose red named "&cRetour arriere" to run [make player execute command "/box"]
       else if arg 1 is "remove":
           if arg 2 is not set:
               set {_slot} to 0
               if {boxcount} is not set:
                   set {boxcount} to 0
               loop 27 times:
                   unformat slot {_slot} of player
                   format slot {_slot} of player with air to be unstealable
                   add 1 to {_slot}
               format slot 0 of player with paper named "&9Compteur: &b%{boxcount}%" to be unstealable
               set {_slot} to 1
               wait 3 ticks
               loop {boites::*}:
                   set {_loop} to loop-value
                   unformat slot {_slot} of player
                   if {compteur.item%{_loop}%} is not set:
                       set {compteur.item%{_loop}%} to 0
                   format slot {_slot} of player with chest named "&9Nom: &b%{_loop}%" with lore "&9Items: &b%{compteur.item%{_loop}%}%" to run [make player execute command "/box remove %{_loop}%"]
                   add 1 to {_slot}
               format slot 26 of player with rose red named "&cRetour arriere" to run [make player execute command "/box options"]
           else:
               remove arg 2 from {boites::*}
               remove 1 from {boxcount}
               wait 1 tick
               make player execute command "/box remove"
       else if arg 1 is "create":
           if arg 2 is not set:
               set {chat.%player%} to true
               send "&9Box] &bEcrivez le nom de la boite dans le chat"
               send "&cVous avez 10 secondes"
               wait 10 seconds
               if {chat.%player%} is set:
                   clear {chat.%player%}
       else if arg 1 is "additem":
           if arg 2 is not set:
               close player's inventory
               send "&9Box] &bPrenez l'objet dans votre main et faites /magic puis continuez avec le menu"
           else:
               inventory name of current inventory of player is "&cGestion des boites":
                   add 1 to {compteur.item%arg 2%}
                   add player's tool to {boite.%arg 2%::*}
                   send "&9Box] &Item ajouter: %player's tool%" to player
                   clear player's tool
                   make player execute command "/box list %arg 2%"
command /magic:
   permission: box.use
   trigger:
       open chest with 3 rows named "&cGestion des boites" to player
       set {_slot} to 0
       wait 3 ticks
       loop {boites::*}:
           set {_loop} to loop-value
           unformat slot {_slot} of player
           if {compteur.%{_loop}%} is not set:
               set {compteur.%{_loop}%} to 0
           if {compteur.item%{_loop}%} is not set:
               set {compteur.item%{_loop}%} to 0
           format slot {_slot} of player with chest named "&9Nom: &b%{_loop}%" with lore "&9Items: &b%{compteur.item%{_loop}%}%" to run [make player execute command "/box additem %{_loop}%"]
           add 1 to {_slot}

on chat:
   if {chat.%player%} is true:
       {boites::*} contains message:
           stop
       else:
           cancel event
           add message to {boites::*}
           send "&9Box] &bVous venez d'ajouter la boite %message%"
           wait 1 second
           clear {chat.%player%}
           make player execute command "/box"
           add 1 to {boxcount}
command /test:
   trigger:
       send "%{boites::*}%"

 

 

Si je fais ca ca marche ?

add player's tool to {itemlist.%{boites::%arg 2%}%::*}

0 réponse à cette question

Messages recommandés

Il n’y a pas encore eu de réponse à cette question

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