Siir0x Posté(e) le 19 mars 2017 Posté(e) le 19 mars 2017 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
TheWhiteGamer666 Posté(e) le 22 mars 2017 Posté(e) le 22 mars 2017 si tu veut je peut te le faire sous un code un peu differents car quand tu fais add -75 tu veut lui enlever ou lui ajouter -75 si enlever fais remove 75 to {coins.%uuid of arg 2%}
GhostKiller76 Posté(e) le 23 mars 2017 Posté(e) le 23 mars 2017 remove 75 from {coins.%uuid of arg 2%} ^^
TheWhiteGamer666 Posté(e) le 23 mars 2017 Posté(e) le 23 mars 2017 remove 75 from {coins.%uuid of arg 2%} ^^ Oui dsl j'avais pas le sous les yeux ^^
Siir0x Posté(e) le 23 mars 2017 Auteur Posté(e) le 23 mars 2017 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 ^^
TheWhiteGamer666 Posté(e) le 23 mars 2017 Posté(e) le 23 mars 2017 if player has 64 coal: 16 coal ^^ 1
AltaWineMomoth Posté(e) le 24 mars 2017 Posté(e) le 24 mars 2017 Imagine un joueur fait /shopbuy Spruce(Exemple) UnAutreJoueur Il force la personne a acheter
Siir0x Posté(e) le 24 mars 2017 Auteur Posté(e) le 24 mars 2017 Sa marche ! Merci beaucoup , je passe en resolu 1
Messages recommandés