Aller au contenu

Question

Posté(e)

Version de Minecraft : 1.12.2
Version de Skript : 2.2.5-alpha3

Addons utilisés: SkBee-1.1.0,SkQuery-Lime 4.1.2,TuSKe

Type du skript

Description du script :

Bonjour à tous et as toute,

Comme le titre l'indique je rencontre un petit problème avec une fonction 😅

function menu(p: player,npc: text):
	wait 0.2 seconds
	close inventory of {_p}
	wait 1 ticks
	open chest with 5 rows named "Equipement des %{_npc}%s" to {_p}
	if {%{_p}%.Money} < 5000:
		format slot 19 of {_p} with Red Stained Glass Pane to be unstealable
		format slot 11 of {_p} with Red Stained Glass Pane to be unstealable
		format slot 29 of {_p} with Red Stained Glass Pane to be unstealable
	else:
		format slot 19 of {_p} with Green Stained Glass Pane to be unstealable
		format slot 11 of {_p} with Green Stained Glass Pane to be unstealable
		format slot 29 of {_p} with Green Stained Glass Pane to be unstealable
		
	if {%{_p}%.Money} < 25000:
		format slot 31 of {_p} with Red Stained Glass Pane to be unstealable
		format slot 22 of {_p} with Red Stained Glass Pane to be unstealable
		format slot 13 of {_p} with Red Stained Glass Pane to be unstealable
	else:
		format slot 31 of {_p} with Green Stained Glass Pane to be unstealable
		format slot 22 of {_p} with Green Stained Glass Pane to be unstealable
		format slot 13 of {_p} with Green Stained Glass Pane to be unstealable

	if {%{_p}%.Money} < 50000:
		format slot 24 of {_p} with Red Stained Glass Pane to be unstealable
	else:
		format slot 31 of {_p} with Green Stained Glass Pane to be unstealable

	format slot 18 of {_p} with stick named "Stade1" to run [make {_p} say "/%{_npc}% 1"]
	format slot 30 of {_p} with stick named "Stade2" to run [make {_p} execute command "/%{_npc}% 2"]
	format slot 12 of {_p} with stick named "Stade2" to run [make {_p} execute command "/%{_npc}% 3"]	
	format slot 23 of {_p} with Blaze rod named "Stade3" to run [make {_p} execute command "/%{_npc}% 4"]
	format slot 25 of {_p} with Blaze rod named "Stade4" to run [make {_p} execute command "/%{_npc}% 5"]

Ces une fonction assez basique mais je ne sais pour quelle raison les 5 dernières lignes ne fonctionne pas...

 

Révélation

2020-05-01_18_35_13.thumb.png.7cc49be51f77b5a231b71a2d4c0e5f06.png

Le menu marche bien mais rien ne ce passe quand je clic sur les différents items

Merci de votre aide ^^

 

6 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

Essaie ceci :

	format slot 18 of {_p} with stick named "Stade1" to run:
		make {_p} execute command "/%{_npc}% 1"
	format slot 30 of {_p} with stick named "Stade2" to run:
		make {_p} execute command "/%{_npc}% 2"
	format slot 12 of {_p} with stick named "Stade2" to run:
		make {_p} execute command "/%{_npc}% 3"
	format slot 23 of {_p} with Blaze rod named "Stade3" to run:
		make {_p} execute command "/%{_npc}% 4"
	format slot 25 of {_p} with Blaze rod named "Stade4" to run:
		make {_p} execute command "/%{_npc}% 5"

Toutefois, tu peux aussi faire :

	format slot 18 of {_p} with stick named "Stade1" to close then run [execute player command "/%{_npc}% 1"]
	format slot 30 of {_p} with stick named "Stade2" to close then run [execute player command "/%{_npc}% 2"]
	format slot 12 of {_p} with stick named "Stade2" to close then run [execute player command "/%{_npc}% 3"]
	format slot 23 of {_p} with Blaze rod named "Stade3" to close then run [execute player command "/%{_npc}% 4"]
	format slot 25 of {_p} with Blaze rod named "Stade4" to close then run [execute player command "/%{_npc}% 5"]

 

Modifié par Lou'
  • 0
Posté(e)
Le 01/05/2020 à 20:11, Lou' a dit :

Essaie ceci :


	format slot 18 of {_p} with stick named "Stade1" to run:
		make {_p} execute command "/%{_npc}% 1"
	format slot 30 of {_p} with stick named "Stade2" to run:
		make {_p} execute command "/%{_npc}% 2"
	format slot 12 of {_p} with stick named "Stade2" to run:
		make {_p} execute command "/%{_npc}% 3"
	format slot 23 of {_p} with Blaze rod named "Stade3" to run:
		make {_p} execute command "/%{_npc}% 4"
	format slot 25 of {_p} with Blaze rod named "Stade4" to run:
		make {_p} execute command "/%{_npc}% 5"

Toutefois, tu peux aussi faire :


	format slot 18 of {_p} with stick named "Stade1" to close then run [execute player command "/%{_npc}% 1"]
	format slot 30 of {_p} with stick named "Stade2" to close then run [execute player command "/%{_npc}% 2"]
	format slot 12 of {_p} with stick named "Stade2" to close then run [execute player command "/%{_npc}% 3"]
	format slot 23 of {_p} with Blaze rod named "Stade3" to close then run [execute player command "/%{_npc}% 4"]
	format slot 25 of {_p} with Blaze rod named "Stade4" to close then run [execute player command "/%{_npc}% 5"]

 

Merci de ta réponse mais le problème étant que dans une fonction il n'y as pas de Player donc ça ne peux pas fonctionner de cette façon

  • 0
Posté(e)

Oula, tu es débutant toi x)
Tu peux simplement remplacer player par la variable  {_p}
Comme ceci :

	format slot 18 of {_p} with stick named "Stade1" to close then run [execute {_p} command "/%{_npc}% 1"]
	format slot 30 of {_p} with stick named "Stade2" to close then run [execute {_p} command "/%{_npc}% 2"]
	format slot 12 of {_p} with stick named "Stade2" to close then run [execute {_p} command "/%{_npc}% 3"]
	format slot 23 of {_p} with Blaze rod named "Stade3" to close then run [execute {_p} command "/%{_npc}% 4"]
	format slot 25 of {_p} with Blaze rod named "Stade4" to close then run [execute {_p} command "/%{_npc}% 5"]
  • 0
Posté(e)
Le 04/05/2020 à 15:51, Lou' a dit :

Oula, tu es débutant toi x)
Tu peux simplement remplacer player par la variable  {_p}
Comme ceci :


	format slot 18 of {_p} with stick named "Stade1" to close then run [execute {_p} command "/%{_npc}% 1"]
	format slot 30 of {_p} with stick named "Stade2" to close then run [execute {_p} command "/%{_npc}% 2"]
	format slot 12 of {_p} with stick named "Stade2" to close then run [execute {_p} command "/%{_npc}% 3"]
	format slot 23 of {_p} with Blaze rod named "Stade3" to close then run [execute {_p} command "/%{_npc}% 4"]
	format slot 25 of {_p} with Blaze rod named "Stade4" to close then run [execute {_p} command "/%{_npc}% 5"]

Nn je suis pas debutant XD

Juste j'avais un probleme avec TuSKe et il prenais pas mes ligne j donc du faire avec SkQuery qui prend pas en charge les variable joueur ici ==>

execute player command "/%{_npc}% 1"
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.