Code:
function createKit(p:player,k:text):
set {_slot} to 0
loop 36 times:
if slot {_slot} of {_p}'s inventory is not air:
set {kit::%{_k}%::slot::%{_slot}%} to slot {_slot} of {_p}'s inventory
add 1 to {_slot}
if {_p}'s helmet is set:
set {kit::%{_k}%::helmet} to {_p}'s helmet
if {_p}'s chestplate is set:
set {kit::%{_k}%::chestplate} to {_p}'s chestplate
if {_p}'s leggings is set:
set {kit::%{_k}%::leggings} to {_p}'s leggings
if {_p}'s boots is set:
set {kit::%{_k}%::boots} to {_p}'s boots
set {kit::%{_k}%::offhand} to {_p}'s offhand item
send "&aSucessfuly created %{_k}%" to {_p}