Aller au contenu
  • 0

J'aimerais changer le nom d'un item dans un GUI


Question

Posté(e)

Bonjour/soir à tous,

 

Je vous explique ma situation:

J'ai créer mon skript de cette manière:

 

command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [execute player command "{@zombie}"]


command /zombiegui:
   trigger:
       open chest with 1 rows named "&6Spawner a Zombie" to player
       format slot 0 of the player with mob spawner named "{@nom}" to close then run [execute player command "{@zombie}"]


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 tick
               execute player command "/spawner zombie"

 

Comme vous le voyez, un GUI est créer avec un item: Oeuf de Zombie, quand on clique sur cette oeuf, ça nous ouvre un autre GUI avec un item: spawner qui nous dit si ce spawner est posé ou non.

Mais, de base, j'ai mis: Pas Poser, et je voudrais que ce texte soit changer quand on fais une commande.

J'éspère mettre bien fais expliquer...

 

Merci d'avance :)

13 réponses à cette question

Messages recommandés

  • 0
Posté(e)
J'ai rien saisi, je vois pas où est ton "Pas Poser" et j'ai pas compris ce que tu voulais au final..

le Pas Poser est le nom du bloc dans le GUI, et ce nom je voudrais le changer en Poser quand le joueur execute une commande

  • 0
Posté(e)

Tu dois enregistrer une variable avec comme valeur true quand le joueur fais la commande. Ensuite, tu dois tester si ta variable est set ou non quand tu met l'item dans le GUI. Si elle n'est pas set, tu met comme nom "Pas posé", sinon tu met "Posé".

Par exemple:

on command "TA COMMANDE":
   command sender is a player
   set {zombie.pose.%uuid of player%} to true
command /zombiegui:
   trigger:
       command sender is a player
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {zombie.pose.%uuid of player%} is not set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close

  • J'aime 1
  • 0
Posté(e)
Tu dois enregistrer une variable avec comme valeur true quand le joueur fais la commande. Ensuite, tu dois tester si ta variable est set ou non quand tu met l'item dans le GUI. Si elle n'est pas set, tu met comme nom "Pas posé", sinon tu met "Posé".

Par exemple:

on command "TA COMMANDE":
   command sender is a player
   set {zombie.pose.%uuid of player%} to true
command /zombiegui:
   trigger:
       command sender is a player
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {zombie.pose.%uuid of player%} is not set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close

Huuuumm... Beaucoup d'erreur générer

  • 0
Posté(e)
Tu dois enregistrer une variable avec comme valeur true quand le joueur fais la commande. Ensuite, tu dois tester si ta variable est set ou non quand tu met l'item dans le GUI. Si elle n'est pas set, tu met comme nom "Pas posé", sinon tu met "Posé".

Par exemple:

on command "TA COMMANDE":
   command sender is a player
   set {zombie.pose.%uuid of player%} to true
command /zombiegui:
   trigger:
       command sender is a player
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {zombie.pose.%uuid of player%} is not set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close

Options:
   zombie: /zombie
   nom: &4Pas poser


command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [execute player command "{@zombie}"]


command /zombiegui:
   trigger:
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {zombie.pose.%uuid of player%} is not set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 tick
               execute player command "/spawner zombie"

  • 0
Posté(e)

Essaie ça :

 

Options:
   zombie: /zombie
   nom: &4Pas poser


command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [execute player command "{@zombie}"]


command /zombiegui:
   trigger:
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {spawner.zombie.%uuid of player%} isn't set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 tick
               execute player command "/spawner zombie"
               set {spawner.zombie.%uuid of player%} to true

  • 0
Posté(e)
Essaie ça :

 

Options:
   zombie: /zombie
   nom: &4Pas poser


command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [execute player command "{@zombie}"]


command /zombiegui:
   trigger:
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {spawner.zombie.%uuid of player%} isn't set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 tick
               execute player command "/spawner zombie"
               set {spawner.zombie.%uuid of player%} to true

Aucune erreur, mais quand je clique sur mon oeuf, cela me met le zombiegui mais me le quitte direct :(

  • 0
Posté(e)
Essaie ça :

 

Options:
   zombie: /zombie
   nom: &4Pas poser


command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [execute player command "{@zombie}"]


command /zombiegui:
   trigger:
       open chest with 1 rows named "&6Spawner a Zombie" to player
       if {spawner.zombie.%uuid of player%} isn't set:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "{@zombie}"]
       else:
           format slot 0 of the player with mob spawner named "Posé" to close


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 tick
               execute player command "/spawner zombie"
               set {spawner.zombie.%uuid of player%} to true

Une idée ?

  • 0
Posté(e)
Mon code marche, essaie juste de reset ta variable comme ça:

 

command /e:
   trigger:
       clear {spawner.zombie.%uuid of player%}

Bon, j'ai réglé mes problèmes, mais maintenant, quand je clique sur le slot nomé "pas posé" cela ne m’exécute rien, totu comme Posé...

 

command /blowspawner:
   trigger:
       open chest with 3 rows named "&6Menu Spawner" to player
       format slot 0 of the player with zombie spawn egg named "&5Spawner a Zombie" to close then run [make player execute command "/zombiegui"]


command /zombiegui:
   trigger:
       send "Ouverture du menu, veuillez patientez" to player
       wait 0.5 second
       open chest with 3 rows named "&6Spawner a Zombie" to player
       if {spawner.zombie.%uuid of player%} is true:
           format slot 0 of the player with mob spawner named "Pas posé" to close then run [execute player command "/zombie"]
       if {spawner.zombie.%uuid of player%} is false:
           format slot 0 of the player with mob spawner named "Posé" to close then run [execute player command "/despawn"]


command /zombie:
   trigger:
       if player have permission "zombie.spawner":
           if targeted block is stone:
               set targeted block to mob spawner
               wait 1 second
               execute player command "/spawner zombie"
               set {spawner.zombie.%uuid of player%} to true

command /despawn:
   trigger:
       if player have permission "blowspawner.despawn":
           if targeted block is mob spawner:
               set targeted block to stone
               set {spawner.zombie.%uuid of player%} to false

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