I agree with Satoh that the problem is probably that each time an entity that cannot interact is checked, then the method return_no_effect() is being called. So kudos to Satoh. (By the way, is it "e:return_no_effect()" or "self:return_no_effect()? Well, it does not matter.) I propose a similar code (using a return instead of using the "overlapping" variable), although this code would not allow to activate several interactive entities at the same time:
Code (Lua) Select
-- Ocarina script.
local item = ...
local m = item:get_map()
local h = m:get_hero()
function item:activate_ocarina_entities()
for e in m:get_entities("ocarina_zelda") do
if h:overlaps(e) then
e:on_zelda_lullaby_interaction()
return
end
end
self:return_no_effect()
end