Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ranger_spawn_check( ply, mobpos, filter_ent )
- local tracedata = {}
- tracedata.start = mobpos + Vector( 0, 0, 5 )
- local Normal_Vec = Vector( 0, 0, 70 )
- if ply:Crouching() then
- Normal_Vec = Vector( 0, 0, 40 )
- end
- tracedata.endpos = ply:GetPos() + Normal_Vec
- tracedata.filter = filter_ent
- local trace = util.TraceLine(tracedata)
- if trace.HitNonWorld then
- if trace.Entity then
- if trace.Entity == ply then
- return false
- end
- end
- end
- local tracedata = {}
- tracedata.start = mobpos + Vector( 0, 0, 65 )
- local Normal_Vec = Vector( 0, 0, 70 )
- if ply:Crouching() then
- Normal_Vec = Vector( 0, 0, 40 )
- end
- tracedata.endpos = ply:GetPos() + Normal_Vec
- tracedata.filter = Mobs
- local trace = util.TraceLine(tracedata)
- if trace.HitNonWorld then
- if trace.Entity then
- if trace.Entity == ply then
- return false
- end
- end
- end
- if mobpos:Distance( ply:GetPos() ) < 600 then
- return false
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement