Hello, j'ai un skript qui crée un GUI, et j'aimerais essayé de réduire le nombre de lignes en mettant tout ce qui suit avec un loop:
sub "GUI_abri":
set {_player} to parameter 1
set inventory name of {_player}'s current inventory to "Abri - Niveau 0 à -5"
wait 1 ticks
format slot 0 of {_player} with {salle_abri.%{_player}%::1} to run [invoke "GUI_salles" from {_player} and 1]
format slot 1 of {_player} with {salle_abri.%{_player}%::2} to run [invoke "GUI_salles" from {_player} and 2]
format slot 2 of {_player} with {salle_abri.%{_player}%::3} to run [invoke "GUI_salles" from {_player} and 3]
format slot 3 of {_player} with {salle_abri.%{_player}%::4} to run [invoke "GUI_salles" from {_player} and 4]
format slot 4 of {_player} with {salle_abri.%{_player}%::5} to run [invoke "GUI_salles" from {_player} and 5]
format slot 5 of {_player} with {salle_abri.%{_player}%::6} to run [invoke "GUI_salles" from {_player} and 6]
format slot 6 of {_player} with {salle_abri.%{_player}%::7} to run [invoke "GUI_salles" from {_player} and 7]
format slot 7 of {_player} with {salle_abri.%{_player}%::8} to run [invoke "GUI_salles" from {_player} and 8]
format slot 8 of {_player} with {salle_abri.%{_player}%::9} to run [invoke "GUI_salles" from {_player} and 9]
format slot 9 of {_player} with {salle_abri.%{_player}%::10} to run [invoke "GUI_salles" from {_player} and 10]
format slot 10 of {_player} with {salle_abri.%{_player}%::11} to run [invoke "GUI_salles" from {_player} and 11]
format slot 11 of {_player} with {salle_abri.%{_player}%::12} to run [invoke "GUI_salles" from {_player} and 12]
format slot 12 of {_player} with {salle_abri.%{_player}%::13} to run [invoke "GUI_salles" from {_player} and 13]
format slot 13 of {_player} with {salle_abri.%{_player}%::14} to run [invoke "GUI_salles" from {_player} and 14]
format slot 14 of {_player} with {salle_abri.%{_player}%::15} to run [invoke "GUI_salles" from {_player} and 15]
format slot 15 of {_player} with {salle_abri.%{_player}%::16} to run [invoke "GUI_salles" from {_player} and 16]
format slot 16 of {_player} with {salle_abri.%{_player}%::17} to run [invoke "GUI_salles" from {_player} and 17]
format slot 17 of {_player} with {salle_abri.%{_player}%::18} to run [invoke "GUI_salles" from {_player} and 18]
format slot 18 of {_player} with {salle_abri.%{_player}%::19} to run [invoke "GUI_salles" from {_player} and 19]
format slot 19 of {_player} with {salle_abri.%{_player}%::20} to run [invoke "GUI_salles" from {_player} and 20]
format slot 20 of {_player} with {salle_abri.%{_player}%::21} to run [invoke "GUI_salles" from {_player} and 21]
format slot 21 of {_player} with {salle_abri.%{_player}%::22} to run [invoke "GUI_salles" from {_player} and 22]
format slot 22 of {_player} with {salle_abri.%{_player}%::23} to run [invoke "GUI_salles" from {_player} and 23]
format slot 23 of {_player} with {salle_abri.%{_player}%::24} to run [invoke "GUI_salles" from {_player} and 24]
format slot 24 of {_player} with {salle_abri.%{_player}%::25} to run [invoke "GUI_salles" from {_player} and 25]
format slot 25 of {_player} with {salle_abri.%{_player}%::26} to run [invoke "GUI_salles" from {_player} and 26]
format slot 26 of {_player} with {salle_abri.%{_player}%::27} to run [invoke "GUI_salles" from {_player} and 27]
format slot 27 of {_player} with {salle_abri.%{_player}%::28} to run [invoke "GUI_salles" from {_player} and 28]
format slot 28 of {_player} with {salle_abri.%{_player}%::29} to run [invoke "GUI_salles" from {_player} and 29]
format slot 29 of {_player} with {salle_abri.%{_player}%::30} to run [invoke "GUI_salles" from {_player} and 30]
format slot 30 of {_player} with {salle_abri.%{_player}%::31} to run [invoke "GUI_salles" from {_player} and 31]
format slot 31 of {_player} with {salle_abri.%{_player}%::32} to run [invoke "GUI_salles" from {_player} and 32]
format slot 32 of {_player} with {salle_abri.%{_player}%::33} to run [invoke "GUI_salles" from {_player} and 33]
format slot 33 of {_player} with {salle_abri.%{_player}%::34} to run [invoke "GUI_salles" from {_player} and 34]
format slot 34 of {_player} with {salle_abri.%{_player}%::35} to run [invoke "GUI_salles" from {_player} and 35]
format slot 35 of {_player} with {salle_abri.%{_player}%::36} to run [invoke "GUI_salles" from {_player} and 36]
format slot 36 of {_player} with {salle_abri.%{_player}%::37} to run [invoke "GUI_salles" from {_player} and 37]
format slot 37 of {_player} with {salle_abri.%{_player}%::38} to run [invoke "GUI_salles" from {_player} and 38]
format slot 38 of {_player} with {salle_abri.%{_player}%::39} to run [invoke "GUI_salles" from {_player} and 39]
format slot 39 of {_player} with {salle_abri.%{_player}%::40} to run [invoke "GUI_salles" from {_player} and 40]
format slot 40 of {_player} with {salle_abri.%{_player}%::41} to run [invoke "GUI_salles" from {_player} and 41]
format slot 41 of {_player} with {salle_abri.%{_player}%::42} to run [invoke "GUI_salles" from {_player} and 42]
format slot 42 of {_player} with {salle_abri.%{_player}%::43} to run [invoke "GUI_salles" from {_player} and 43]
format slot 43 of {_player} with {salle_abri.%{_player}%::44} to run [invoke "GUI_salles" from {_player} and 44]
format slot 44 of {_player} with {salle_abri.%{_player}%::45} to run [invoke "GUI_salles" from {_player} and 45]
format slot 45 of {_player} with {salle_abri.%{_player}%::46} to run [invoke "GUI_salles" from {_player} and 46]
format slot 46 of {_player} with {salle_abri.%{_player}%::47} to run [invoke "GUI_salles" from {_player} and 47]
format slot 47 of {_player} with {salle_abri.%{_player}%::48} to run [invoke "GUI_salles" from {_player} and 48]
format slot 48 of {_player} with {salle_abri.%{_player}%::49} to run [invoke "GUI_salles" from {_player} and 49]
format slot 49 of {_player} with {salle_abri.%{_player}%::50} to run [invoke "GUI_salles" from {_player} and 50]
format slot 50 of {_player} with {salle_abri.%{_player}%::51} to run [invoke "GUI_salles" from {_player} and 51]
format slot 51 of {_player} with {salle_abri.%{_player}%::52} to run [invoke "GUI_salles" from {_player} and 52]
format slot 52 of {_player} with {salle_abri.%{_player}%::53} to run [invoke "GUI_salles" from {_player} and 53]
format slot 53 of {_player} with {salle_abri.%{_player}%::54} to run [invoke "GUI_salles" from {_player} and 54]
J'ai essayé:
loop {salle_abri.%{_player}%::*}:
format slot [b]loop-index [/b]of {_player} with loop-value to run [invoke "GUI_salles" from {_player} and loop-index]
Mais je rencontre une erreur '{_player} with loop value to run ...... ' is not an item stack ...
En gros, le loop-index en gras pose problème.
Voilà, merci d'avance à ce qui tenteront d'aider.