Aller au contenu

[Shop] Skript de vente.


Messages recommandés

Posté(e)

Version de minecraft : 1.8

Type du skript : Skript de shop

Description du skript :

Bonjours a tous , j'aimerais savoir comme vendre des items par exemple :

Quand le joueur clique sur l'item dans un GUI ,

Sa détecte si le joueur a 16 charbon ,

Si le joueur a les 16 charbon sa ajoute 16 à ses Coins

et si il les as pas sa lui met un message comme quoi il lui faut 16 charbon

Voilà mon code :

on right click on a villager:
   if name of target entity is "&6Bûche":
       cancel event
       open chest with 1 rows named "&aBûche" to player
       wait 1 tick
       format slot 0 of player with spruce wood block named "&9&oAchetez 16 bûches de Sapin" with lore "&b75$ /16" to close then run [make console execute command "shopbuy spruce %player%"]
       format slot 1 of player with oak wood block named "&9&oAchetez 16 bûches de Chêne" with lore "&b75$ /16" to close then run [make console execute command "shopbuy chene %player%"]
       format slot 2 of player with birch wood block named "&9&oAchetez 16 bûches de Bouleau" with lore "&b75$ /16" to close then run [make console execute command "shopbuy birch %player%"]
       format slot 3 of player with jungle wood block named "&9&oAchetez 16 bûches de Jungle" with lore "&b75$ /16" to close then run [make console execute command "shopbuy jungle %player%"]
command /shopbuy [<text>] [<player>]:
   executable by: console
   trigger:
       if arg 1 is "Spruce":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 74:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Bûche de Sapin &7pour &c75$" to arg 2
                   give 16 spruce wood block to arg 2
                   add -75 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
       if arg 1 is "chene":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 74:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Bûche de Chêne &7pour &c75$" to arg 2
                   give 16 oak wood block to arg 2
                   add -75 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
       if arg 1 is "birch":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 74:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Bûche de Bouleau &7pour &c75$" to arg 2
                   give 16 birch wood block to arg 2
                   add -75 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
       if arg 1 is "jungle":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 74:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Bûche de Jungle &7pour &c75$" to arg 2
                   give 16 jungle wood block to arg 2
                   add -75 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
       if arg 1 is "coal":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 249:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Minerais de Charbon &7pour &c250$" to arg 2
                   give 16 coal ore to arg 2
                   add -250 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
       if arg 1 is "iron":
           if arg 2 is set:
               if {coins.%uuid of arg 2%} is above 399:
                   send "&6&oSunShop &8&l» &7Tu as acheter &a16 Minerais de Charbon &7pour &c400$" to arg 2
                   give 16 iron ore to arg 2
                   add -400 to {coins.%uuid of arg 2%}
               else:
                   send "&6&oSunShop &8&l» &cTu n'as pas assez d'argents !" to arg 2
on right click on a villager:
   if name of target entity is "&cMinerais":
       cancel event
       open chest with 2 rows named "&aMinerais" to player
       wait 1 tick
       format slot 9 of player with coal ore named "&9&oVendre 16 minerais de Charbon" with lore "&b200$/16" to close then run [make console execute command "shopsell coal %player%"]
       format slot 0 of player with coal ore named "&9&oAchetez 16 minerais de Charbon" with lore "&b250$/16" to close then run [make console execute command "shopbuy coal %player%"]
       format slot 1 of player with iron ore named "&9&oAchetez 16 minerais de Fer" with lore "&b400$/16" to close then run [make console execute command "shopbuy iron %player%"]

 

 

Merci pour vos réponses , bonne journée a tous

Posté(e)

C'est pas cela que je demande ^^ c'est que par exemple sa regarde dans l'inventaire du joueurs si il a 16 charbon pour qu'il puissent les vendre ^^

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