Азгалор, в функцию можно сразу передавать таблицу:
function NoFlee(heroeslist)
for key, heroes in heroeslist do
if IsObjectExists( heroes ) ~= nil then
DenyAIHeroFlee( heroes, 1 )
print("<color=blue>Герой ", heroes, " <color=blue>больше не покидает бои пока не погибнет")
end
end
end
-- Пример использования
NoFlee({n1, n2, n3});