Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. function ranger_spawn_check( ply, mobpos, filter_ent )
  2.     local tracedata = {}
  3.     tracedata.start = mobpos + Vector( 0, 0, 5 )
  4.     local Normal_Vec = Vector( 0, 0, 70 )
  5.     if ply:Crouching() then
  6.         Normal_Vec = Vector( 0, 0, 40 )
  7.     end
  8.     tracedata.endpos = ply:GetPos() + Normal_Vec
  9.     tracedata.filter = filter_ent
  10.     local trace = util.TraceLine(tracedata)
  11.     if trace.HitNonWorld then
  12.         if trace.Entity then
  13.             if trace.Entity == ply then
  14.                 return false
  15.             end
  16.         end    
  17.     end
  18.    
  19.     local tracedata = {}
  20.     tracedata.start = mobpos + Vector( 0, 0, 65 )
  21.     local Normal_Vec = Vector( 0, 0, 70 )
  22.     if ply:Crouching() then
  23.         Normal_Vec = Vector( 0, 0, 40 )
  24.     end
  25.     tracedata.endpos = ply:GetPos() + Normal_Vec
  26.     tracedata.filter = Mobs
  27.     local trace = util.TraceLine(tracedata)
  28.     if trace.HitNonWorld then
  29.         if trace.Entity then
  30.             if trace.Entity == ply then
  31.                 return false
  32.             end
  33.         end    
  34.     end
  35.    
  36.     if mobpos:Distance( ply:GetPos() ) < 600 then
  37.         return false
  38.     end
  39.     return true
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement