Advertisement
Snowsz

Untitled

Feb 27th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. function isMonsterInArea(fromPos, toPos)
  2. local apos = {}
  3. local monsters = {}
  4. for xx = fromPos.x, toPos.x do
  5. for yy = fromPos.y, toPos.x do
  6. for zz = fromPos.z, toPos.z do
  7. apos = {x = xx, y = yy, z = zz}
  8. local creature = getTopCreature(apos)
  9. if creature.uid > 0 then
  10. if isMonster(creature.uid) then
  11. table.insert(monsters, creature)
  12. end
  13. end
  14. end
  15. end
  16. end
  17. return #monsters <= 0 and false or true
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement