Ups, on a utilisé player dans une fonction ! Merci Bobinho de me l'avoir signalé !
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 {_p}
set {inv.%{_p}%::plastron} to chestplate of {_p}
set {inv.%{_p}%::pantalon} to leggings of {_p}
set {inv.%{_p}%::bottes} to boots of {_p}
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 {_p} to {inv.%{_p}%::casque}
set chestplate of {_p} to {inv.%{_p}%::plastron}
set leggings of {_p} to {inv.%{_p}%::pantalon}
set boots of {_p} to {inv.%{_p}%::bottes}