Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Detects if anything is inside the player's collision hull
- local player = player_youre_tracing
- local pos = player:GetPos()
- local mins, maxs
- if (player:Crouching()) then
- mins, maxs = player:GetHullDuck()
- else
- mins, maxs = player:GetHull()
- end
- local tr = util.TraceHull({
- start = pos,
- endpos = pos,
- mask = MASK_PLAYERSOLID,
- collisiongroup = player:GetCollisionGroup(),
- filter = player,
- mins = mins,
- maxs = maxs
- })
- if (tr.Hit) then
- -- Something is inside the player
- -- tr.Entity will provide exactly what
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement