Bonsoir
Lorsque l'on fait:
add arg to {list:*}
Imaginons que je mette comme argument 1 puis 2 puis 3, si je fais afficher la liste ça me donnera "1, 2, 3", or j'aimerais lire du plus récent au plus ancien soie "3, 2, 1"
Merci
Mc: 1.12.2
SK: 2.2-dev37d
c'était ça le problème ça fonctionne maintenant
on right click on a villager:
cancel event
open chest with 5 rows named "&2&lVendeur" to player
if player's inventory contain wheat:
set {_n} to amount of wheat in player's inventory
set {_$} to {_n}*13
make a gui slot 19 of player with 1 wheat_item named "&r&e&lBlé" with lore "&rtout vendre &r&2%{_$}% bal" to run:
close player's inventory
remove all wheat from player
add {_$} to {bal.%player's uuid%}
message "&2+%{_$}% bal" to player
else:
make a gui slot 19 of player with 1 wheat_item of unbreaking 1 named "&r&e&lBlé" with lore "&cvous n'en possédez pas"
if player's inventory contain carrot_item:
set {_n} to amount of carrot in player's inventory
set {_$} to {_n}*15
make a gui slot 21 of player with 1 carrots_item named "&r&e&lCarrote" with lore "&rtout vendre &r&2%{_$}% bal" to run:
close player's inventory
remove all carrot_item from player
add {_$} to {bal.%player's uuid%}
message "&2+%{_$}% bal" to player
else:
make a gui slot 21 of player with 1 carrots_item of unbreaking 1 named "&r&e&lCarrote" with lore "&cvous n'en possédez pas"
if player's inventory contain potato:
set {_n} to amount of potato in player's inventory
set {_$} to {_n}*13
make a gui slot 23 of player with 1 potato_item named "&r&e&lPatates" with lore "&rtout vendre &r&2%{_$}% bal" to run:
close player's inventory
remove all potato_item from player
add {_$} to {bal.%player's uuid%}
message "&2+%{_$}% bal" to player
else:
make a gui slot 23 of player with 1 potato_item of unbreaking 1 named "&r&e&lPatates" with lore "&cvous n'en possédez pas"
if player's inventory contain sugar_cane_item:
set {_n} to amount of sugar_cane_item in player's inventory
set {_$} to {_n}*13
make a gui slot 25 of player with 1 sugar_cane_item named "&r&e&lCanne à sucre" with lore "&rtout vendre &r&2%{_$}% bal" to run:
close player's inventory
remove all sugar_cane_item from player
add {_$} to {bal.%player's uuid%}
message "&2+%{_$}% bal" to player
else:
make a gui slot 25 of player with 1 sugar_cane_item of unbreaking 1 named "&r&e&lCanne à sucre" with lore "&cvous n'en possédez pas"
ok autant pour moi, je savais pas ?
J'ai un p'tit problème skript comprend les lignes où il n'y a pas d'actions à effectuer mais celles finissant par 'to run:' il fait can't understand.
ex:
make a gui slot 23 of player with 1 potato_item named "&r&e&lPatates" with lore "&rtout vendre &r&2%{_$}% bal" to run:
close player's inventory
remove all potato_item from player
add {_$} to {bal.%player's uuid%}
message "&2+%{_$}% bal" to player
Fait ! j'ai même ajouter les items enchant pour faire comprendre qu'ils sont bloqués si le joueur n'a pas l'item sur lui enfin bref .Seul problème j'ai pas idée de pourquoi mais pour script les gold carrots= carrot, pareil pour les patates pas cuite=cuite, du coup si t'as des patates cuites et pas cuites dans ton inventaire ça peut prendre l'un des deux, ça doit être une question d'id spéciaux
voilà:
on right click on a villager:
cancel event
make console execute command "/vendre %player%"
command /vendre [<player>] [<text>]:
executable by: console
trigger:
if arg 1 is a player:
if arg 2 is not set:
wait 2 ticks
open chest with 5 rows named "&2&lVendeur" to arg 1
wait 1 tick
if arg 1's inventory contain wheat:
set {_n} to amount of wheat in arg 1's inventory
set {$.%arg 1%} to {_n}*18
format slot 19 of arg 1 with wheat_item named "&r&e&lBlé" with lore "&rtout vendre:||&r&2%{$.%arg 1%}% bal" to close then run [make console execute command "/vendre %arg 1% blé"]
else:
format slot 19 of arg 1 with wheat_item of unbreaking 1 named "&r&e&lBlé" with lore "&r&cvous ne possédez pas de blé" to be unstealable
if arg 1's inventory contain carrot_item:
set {_n} to amount of carrot in arg 1's inventory
set {$.%arg 1%} to {_n}*15
format slot 21 of arg 1 with carrot_item named "&r&e&lCarrote" with lore "&rtout vendre:||&r&2%{$.%arg 1%}% bal" to close then run [make console execute command "/vendre %arg 1% carrot"]
else:
format slot 21 of arg 1 with carrots_item of unbreaking 1 named "&r&e&lCarrote" with lore "&r&cvous ne possédez pas de carrotes" to be unstealable
if arg 1's inventory contain potato:
set {_n} to amount of potato in arg 1's inventory
set {$.%arg 1%} to {_n}*15
format slot 23 of arg 1 with potato_item named "&r&e&lPatates" with lore "&rtout vendre:||&r&2%{$.%arg 1%}% bal" to close then run [make console execute command "/vendre %arg 1% potato"]
else:
format slot 23 of arg 1 with potato_item of unbreaking 1 named "&r&e&lPatates" with lore "&r&cvous ne possédez pas de patates" to be unstealable
if arg 1's inventory contain sugar_cane_item:
set {_n} to amount of sugar_cane_item in arg 1's inventory
set {$.%arg 1%} to {_n}*13
format slot 25 of arg 1 with sugar_cane_item named "&r&e&lCanne à suce" with lore "&rtout vendre:||&r&2%{$.%arg 1%}% bal" to close then run [make console execute command "/vendre %arg 1% sugar"]
else:
format slot 25 of arg 1 with sugar_cane_item of unbreaking 1 named "&r&e&lCanne à sucre" with lore "&r&cvous ne possédez pas de canne à sucre" to be unstealable
if arg 2 is "blé":
remove all wheat from arg 1
add {$.%arg 1%} to {bal.%arg 1's uuid%}
message "&2+%{$.%arg 1%}% bal" to arg 1
if arg 2 is "carrot":
remove all carrot_item from arg 1
add {$.%arg 1%} to {bal.%arg 1's uuid%}
message "&2+%{$.%arg 1%}% bal" to arg 1
if arg 2 is "potato":
remove all potato from arg 1
add {$.%arg 1%} to {bal.%arg 1's uuid%}
message "&2+%{$.%arg 1%}% bal" to arg 1
if arg 2 is "sugar":
remove all sugar_cane_item from arg 1
add {$.%arg 1%} to {bal.%arg 1's uuid%}
message "&2+%{$.%arg 1%}% bal" to arg 1
oui mais juste pour être sûr tu veux que quand tu cliques droit sur un villageois avec du blé ou les autres items ce dernier soit remove et qu'il gagne de l'argent ?
Ou alors remove par stack ?
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.