lua code:
--Config
local creatct = 2 -- Number of creatures to play alarm
local dist = 4 -- Distance to consider monsters
-- Don't touch this if you don't know what are you doing
while (true) do
local creature = Creature.GetByID(Self.TargetID())
local amount = 0
for _, c in Creature.iMonsters(dist) do
if c:isAlive() and c:isOnScreen() then
amount = amount +1
end
end
if creature:isValid() and creature:isAlive() and amount >= creatct then
alert()
end
end
Have fun =D