Advertisement
CapsAdmin

Untitled

Apr 25th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local last_goto = 0
  2.  
  3. hook.Add("CreateMove", "follow", function(cmd)
  4.     local ply = LocalPlayer()
  5.     local target = player.GetByUniqueID(--[[KpK.Y0uM]] "3231181953") or NULL
  6.        
  7.     if target:IsValid() then           
  8.         local apos = ply:EyePos()
  9.         local bpos = target:EyePos()
  10.            
  11.         local offset = bpos - apos
  12.         local length = offset:Length()
  13.            
  14.         local ang = offset:Angle()
  15.         ang.p = math.NormalizeAngle(ang.p)
  16.            
  17.         if not target:Alive() and ply:Alive() then
  18.             RunConsoleCommand("aowl", "kill")
  19.         elseif target:Alive() and not ply:Alive() then
  20.             RunConsoleCommand("aowl", "revive")
  21.         end
  22.            
  23.         if last_goto < SysTime() and target:Alive() and ply:Alive() and util.TraceLine({start = apos, endpos = bpos, filter = {ply, target}}).Fraction ~= 1 then
  24.             RunConsoleCommand("aowl", "goto", target:UniqueID())
  25.             last_goto = SysTime() + 1
  26.         end
  27.        
  28.         if length > 100 then
  29.             cmd:SetForwardMove(1000)           
  30.         end
  31.            
  32.         cmd:SetViewAngles(ang)
  33.     end
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement