Si je puis me permettre, il faut aussi sauvegarder la main gauche ^^ Et donc ça donnerai :
function inventoryManager(action: text, p: player):
if {_action} is "save":
loop 36 times:
add slot (loop-number - 1) of {_p}'s inventory to {inv.%{_p}%::items::*}
set {inv.%{_p}%::maingauche} to slot 40 of {_p}'s inventory
set {inv.%{_p}%::casque} to helmet of player
set {inv.%{_p}%::plastron} to chestplate of player
set {inv.%{_p}%::pantalon} to leggings of player
set {inv.%{_p}%::bottes} to boots of player
if {_action} is "give":
set {_s} to 0
loop {inv.%{_p}%::items::*}:
set slot {_s} of {_p}'s inventory to loop-value
add 1 to {_s}
set slot 40 of {_p}'s inventory to {inv.%{_p}%::maingauche}
set helmet of player to {inv.%{_p}%::casque}
set chestplate of player to {inv.%{_p}%::plastron}
set leggings of player to {inv.%{_p}%::pantalon}
set boots of player to {inv.%{_p}%::bottes}