Aller au contenu

Messages recommandés

Posté(e) (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

210301035800263351.png

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é par Aclaya
Posté(e) (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:

210301035800263351.png

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é par LOUDO
  • Merci 1
Posté(e)
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)...

 

Posté(e)
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

 

  • Merci 1
Posté(e)
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 ! 

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • 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.