Advertisement
Cavitt

Targetter reset

Feb 23rd, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. local maxDistance = 3 -- max sqms the target can be before resetting the targeter
  2.  
  3. local function check()
  4.     local target = Creature.GetByID(Self.TargetID())
  5.     if(target:isValid() and target:isAlive() and target:isVisible())then
  6.         if(target:DistanceFromSelf() > maxDistance)then
  7.             setTargetingEnabled(false)
  8.             setTargetingEnabled(true)
  9.         end
  10.     end
  11. end
  12.  
  13. while(true)do
  14.     check()
  15.     wait(500)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement