Aclaya Posté(e) le 1 mars 2021 Posté(e) le 1 mars 2021 (modifié) Version de Minecraft : 1.8.9 Version de Skript : 2.1.2 Type du skript : GUI Blocs Vert/Rouge Description du script : Salut ! J'aimerais de l'aide pour faire en sorte que si le joueur est niveau 1, le bloc vert apparaît a la place du rouge... ainsi de suite. Merci de votre aide ! 😉 J'utilise ceci pour les niveaux: Citation on first join: if {niveau.%player%} is not set: set {niveau.%player%} to 1 Voici le code que j'utilise pour le menu: Citation command /menu: trigger: wait a tick open chest with 5 row named "&aMenu" to player format slot 0 of player with green glass pane named "&l" to be unstealable format slot 1 of player with green glass pane named "&l" to be unstealable format slot 7 of player with green glass pane named "&l" to be unstealable format slot 8 of player with green glass pane named "&l" to be unstealable format slot 9 of player with green glass pane named "&l" to be unstealable format slot 17 of player with green glass pane named "&l" to be unstealable format slot 18 of player with green glass pane named "&l" to be unstealable format slot 26 of player with green glass pane named "&l" to be unstealable format slot 27 of player with green glass pane named "&l" to be unstealable format slot 35 of player with green glass pane named "&l" to be unstealable format slot 36 of player with green glass pane named "&l" to be unstealable format slot 37 of player with green glass pane named "&l" to be unstealable format slot 40 of player with arrow named "&fRetour" to close format slot 43 of player with green glass pane named "&l" to be unstealable format slot 44 of player with green glass pane named "&l" to be unstealable Modifié le 1 mars 2021 par Aclaya
LOUDO Posté(e) le 1 mars 2021 Posté(e) le 1 mars 2021 (modifié) il y a une heure, Aclaya a dit : Version de Minecraft : 1.8.9 Version de Skript : 2.1.2 Type du skript : GUI Blocs Vert/Rouge Description du script : Salut ! J'aimerais de l'aide pour faire en sorte que si le joueur est niveau 1, le bloc vert apparaît a la place du rouge... ainsi de suite. Merci de votre aide ! 😉 J'utilise ceci pour les niveaux: Voici le code que j'utilise pour le menu: Salut, voilà ! Citation on first join: if {niveau.%player%} is not set: set {niveau.%player%} to 1 command /menu: trigger: wait a tick open chest with 5 row named "&aMenu" to player format slot 0 of player with green glass pane named "&l" to be unstealable format slot 1 of player with green glass pane named "&l" to be unstealable format slot 7 of player with green glass pane named "&l" to be unstealable format slot 8 of player with green glass pane named "&l" to be unstealable format slot 9 of player with green glass pane named "&l" to be unstealable format slot 17 of player with green glass pane named "&l" to be unstealable format slot 18 of player with green glass pane named "&l" to be unstealable format slot 26 of player with green glass pane named "&l" to be unstealable format slot 27 of player with green glass pane named "&l" to be unstealable format slot 35 of player with green glass pane named "&l" to be unstealable format slot 36 of player with green glass pane named "&l" to be unstealable format slot 37 of player with green glass pane named "&l" to be unstealable format slot 40 of player with arrow named "&fRetour" to close format slot 43 of player with green glass pane named "&l" to be unstealable format slot 44 of player with green glass pane named "&l" to be unstealable format slot 11 of player with red glass block named "&l" to be unstealable format slot 12 of player with red glass block named "&l" to be unstealable format slot 13 of player with red glass block named "&l" to be unstealable format slot 14 of player with red glass block named "&l" to be unstealable format slot 15 of player with red glass block named "&l" to be unstealable format slot 20 of player with red glass block named "&l" to be unstealable format slot 21 of player with red glass block named "&l" to be unstealable format slot 22 of player with red glass block named "&l" to be unstealable format slot 23 of player with red glass block named "&l" to be unstealable format slot 24 of player with red glass block named "&l" to be unstealable format slot 29 of player with red glass block named "&l" to be unstealable format slot 30 of player with red glass block named "&l" to be unstealable format slot 31 of player with red glass block named "&l" to be unstealable format slot 32 of player with red glass block named "&l" to be unstealable format slot 33 of player with red glass block named "&l" to be unstealable set {_level} to {niveau.%player%} set {_slot} to 11 loop {_level} times: set {_glass.%loop-value%} to "green glass block" set {_glass.%loop-value%} to "%{_glass.%loop-value%}%" parsed as item type format slot {_slot} of player with {_glass.%loop-value%} named "&l" to be unstealable add 1 to {_slot} if {_slot} = 16 or 25: set {_slot} to ({_slot} + 4) if {_slot} = 34: stop Par contre je te conseille d'utiliser TusKe car c'est beaucoup plus optimisé ! Regarde ce que ça peut faire avec TusKe Citation on first join: if {niveau.%player%} is not set: set {niveau.%player%} to 1 command /menu: trigger: wait a tick open chest with 5 row named "&aMenu" to player format gui slot 0, 1, 7, 8, 9, 17, 18, 26, 27, 35, 36, 37, 43, 44 of player with green glass pane named "&l" to do nothing format gui slot 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 29, 30, 31, 32, 33 of player with red glass block named "&l" to do nothing format gui slot 40 of player with arrow named "&fRetour" to close set {_level} to {niveau.%player%} set {_slot} to 11 loop {_level} times: set {_glass.%loop-value%} to "green glass block" set {_glass.%loop-value%} to "%{_glass.%loop-value%}%" parsed as item type format gui slot {_slot} of player with {_glass.%loop-value%} named "&l" to do nothing add 1 to {_slot} if {_slot} = 16 or 25: set {_slot} to ({_slot} + 4) if {_slot} = 34: stop Voilà , j'espère t'avoir aidé ! Modifié le 1 mars 2021 par LOUDO 1
Aclaya Posté(e) le 1 mars 2021 Auteur Posté(e) le 1 mars 2021 il y a 49 minutes, LOUDO a dit : Salut, voilà ! Par contre je te conseille d'utiliser TusKe car c'est beaucoup plus optimisé ! Regarde ce que ça peut faire avec TusKe Voilà , j'espère t'avoir aidé ! Salut ! Merci de ta réponse. J'ai utilisé la méthode avec TusKe ça fonctionne parfaitement ! J'ai oublié de préciser un truc. C'est possible de faire en sorte que chaque bloc vert exécute une command ? (exemple: /niveau 1 pour le premier bloc vert)...
LOUDO Posté(e) le 1 mars 2021 Posté(e) le 1 mars 2021 il y a 11 minutes, Aclaya a dit : Salut ! Merci de ta réponse. J'ai utilisé la méthode avec TusKe ça fonctionne parfaitement ! J'ai oublié de préciser un truc. C'est possible de faire en sorte que chaque bloc vert exécute une command ? (exemple: /niveau 1 pour le premier bloc vert)... Salut ! Oui ! (Conseils: pour plus d'optimisation, je te conseille d'utiliser une fonction avec SkQuery au lieu d'une commande pour effectuer des taches 🙂) Sinon remplace l'ancienne boucle par celle ci-dessous loop {_level} times: add 1 to {_l} set {_glass.%loop-value%} to "green glass block" set {_glass.%loop-value%} to "%{_glass.%loop-value%}%" parsed as item type format gui slot {_slot} of player with {_glass.%loop-value%} named "&l" to run: make player execute command "/niveau %{_l}%" close player's inventory add 1 to {_slot} if {_slot} = 16 or 25: set {_slot} to ({_slot} + 4) if {_slot} = 34: stop 1
Aclaya Posté(e) le 1 mars 2021 Auteur Posté(e) le 1 mars 2021 il y a 12 minutes, LOUDO a dit : Salut ! Oui ! (Conseils: pour plus d'optimisation, je te conseille d'utiliser une fonction avec SkQuery au lieu d'une commande pour effectuer des taches 🙂) Sinon remplace l'ancienne boucle par celle ci-dessous loop {_level} times: add 1 to {_l} set {_glass.%loop-value%} to "green glass block" set {_glass.%loop-value%} to "%{_glass.%loop-value%}%" parsed as item type format gui slot {_slot} of player with {_glass.%loop-value%} named "&l" to run: make player execute command "/niveau %{_l}%" close player's inventory add 1 to {_slot} if {_slot} = 16 or 25: set {_slot} to ({_slot} + 4) if {_slot} = 34: stop Merci beaucoup de ton aide !
LOUDO Posté(e) le 1 mars 2021 Posté(e) le 1 mars 2021 il y a 4 minutes, Aclaya a dit : Merci beaucoup de ton aide ! De rien ! N’hésite pas à passer en mode résolu 😄
Yghore Posté(e) le 2 mars 2021 Posté(e) le 2 mars 2021 Le sujet a été résolu. Il a donc été verrouillé. Cordialement, l'équipe.
Messages recommandés