for i=1, 4 do local stack = player_inv:get_stack("armor", i) local item = stack:get_name() if stack:get_count() == 1 then local def = stack:get_definition() for k, v in pairs(elements) do if v == false then local level = def.groups["armor_"..k] "list[detached:"..name.."_armor;armor1;0.25,1.25;1,2;]"..