local fromPos = {x = 100, y = 100, z = 7}
local toPos = {x= 200, y = 200, z = 7}
local amount = 0
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local monster = getTopCreature({x=x,y=y,z=z}).uid
if(isMonster(monster) == TRUE) then
amount = amount+1
end
end
end
end
if(amount >= 1) then
return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "There are "..amount.." monsters in the area.")
end