With apples in main inventory it works, but with space helmet in armor inv - not
What I do wrong?
Code: Select all
local skippy = 0
minetest.register_globalstep(function(dtime)
skippy = skippy + 1
if skippy < 10 then
return
end
skippy = 0
for _, player in ipairs(minetest.get_connected_players()) do
if player:get_pos().y > 1000 then
local inv = player:get_inventory()
if not (inv:contains_item("armor", "3d_armor:helmet") or inv:contains_item("main", "default:apple")) then
if player:get_hp() > 0 then
player:set_hp(player:get_hp() - 8)
end
end
end
end
end)