Aller au contenu
  • 0

Créer une condition...?


Question

Posté(e)

Salut c'est encore moi :)

Encore une fois après avoir parcouru les tutoriels je me tourne vers la section aide.

 

Aujourd'hui je souhaiterais créer une sorte de condition, une condition pour un achat.

Par exemple un seau d'eau à 25$, comme dans ma dernière demande, et pour l'obtenir que le joueur ai l'obligation d'avoir 25$ (ce qui dans le fond est logique).

D'ailleurs merci à PsYZiik pour le code ^^

Voici le code que j'ai actuellement (mais le joueur n'est pas forcé d'avoir 25$):

command /Objets:
 trigger:
   close player's inventory # On doit fermer l'inventaire du joueur
   wait 2 ticks
   open chest with 3 rows named "&2&lObjets" to player # Et le réouvrir par la suite
   wait 2 ticks
   format slot 12 of player with 1 sand named "sand" to be unstealable
   format slot 0 of player with bucket of water named "&e&lSeau d'eau" with lore "&225 $" to close then run [make player execute command "/eco take %player% 25"]
   format slot 1 of player with bucket of lava named "&e&lSeau de lave" with lore "&250 $" to close then run [make player execute command "/eco take %player% 50"]=>[make player execute command "/give %player% 327 1"]
   format slot 2 of player with bucket of water named "&e&lSeau d'eau" with lore "25 €" to close then run [invoke "TonSub" from player]

Sub "TonSub":
   set {_p} to parameter 1
   wait 1 tick
   make {_p} execute command "/eco take %players% 25"
   make {_p} execute command "/give %players% 326 1"

 

J’espère que vous pourrez m'aider :)

 

Et je suis vraiment désolé je ne sais vraiment pas comment faire et je ne sais pas si j'ai été asser claire :/

Merci d'avance ;)

3 réponses à cette question

Messages recommandés

  • 0
Posté(e)
command /Objets:
 trigger:
   close player's inventory # On doit fermer l'inventaire du joueur
   wait 2 ticks
   open chest with 3 rows named "&2&lObjets" to player # Et le réouvrir par la suite
   wait 2 ticks
   format slot 12 of player with 1 sand named "sand" to be unstealable
   format slot 0 of player with bucket of water named "&e&lSeau d'eau" with lore "&225 $" to close then run [make player execute command "/eco take %player% 25"]
   format slot 1 of player with bucket of lava named "&e&lSeau de lave" with lore "&250 $" to close then run [make player execute command "/eco take %player% 50"]=>[make player execute command "/give %player% 327 1"]
   format slot 2 of player with bucket of water named "&e&lSeau d'eau" with lore "25 €" to close then run [invoke "TonSub" from player]

Sub "TonSub":
   set {_p} to parameter 1
   wait 1 tick
   if {_p}'s balance is less than 25:
       send "&cPas assez d'argent !" to {_p}
   else:
       execute console command "/eco take %{_p}% 25"
       execute console command "/give %{_p}% 326 1"

  • J'aime 1
  • 0
Posté(e)
command /Objets:
 trigger:
   close player's inventory # On doit fermer l'inventaire du joueur
   wait 2 ticks
   open chest with 3 rows named "&2&lObjets" to player # Et le réouvrir par la suite
   wait 2 ticks
   format slot 12 of player with 1 sand named "sand" to be unstealable
   format slot 0 of player with bucket of water named "&e&lSeau d'eau" with lore "&225 $" to close then run [make player execute command "/eco take %player% 25"]
   format slot 1 of player with bucket of lava named "&e&lSeau de lave" with lore "&250 $" to close then run [make player execute command "/eco take %player% 50"]=>[make player execute command "/give %player% 327 1"]
   format slot 2 of player with bucket of water named "&e&lSeau d'eau" with lore "25 €" to close then run [invoke "TonSub" from player]

Sub "TonSub":
   set {_p} to parameter 1
   wait 1 tick
   if {_p}'s balance is less than 25:
       send "&cPas assez d'argent !" to {_p}
   else:
       execute console command "/eco take %{_p}% 25"
       execute console command "/give %{_p}% 326 1"

 

Merci beaucoup :)

Je passe la discussion en résolu ^^

  • J'aime 1
×
×
  • 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.