MaXwEllDeN

Untitled

Jun 16th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function isLookingAt(uid, target)
  2. local var = {
  3. [0] = "x",
  4. [1] = "y",
  5. [2] = "x",
  6. [3] = "y",
  7. }
  8.  
  9. local look = getCreatureLookDirection(uid)
  10.  
  11. local pos_a, pos_b = getThingPos(uid), getThingPos(target)
  12.  
  13. if math.abs(look - getCreatureLookDirection(itemEx.uid)) == 2 and pos_a[var[look]] == pos_b[var[look]] then
  14. return true
  15. end
  16.  
  17. return false
  18. end
Advertisement
Add Comment
Please, Sign In to add comment