Is there a material that blocks bullets but not players?

Kataiser

L1: Registered
Aug 3, 2015
47
2
I figured that Block Bullets would stop bullets (including rockets and pills) from passing through. Turns out, that's not the case. Is there a material that I can apply to a brush that would do that?
 

Exactol

Certified Hammer Hacker
aa
Jul 11, 2013
421
537
There is actually a way to do this!

Create a brush with nodraw/trigger texture, make it a func_physbox_multiplayer, make sure these flags are checked:

  • Start Asleep

  • Debris

  • Motion Disabled

  • Only Break on Trigger

  • Don't Take Physics Damage

  • Don't Allow Bullet Penetration

  • Prevent Motion Enable on Player Bump
Uncheck the rest.

Also, set these keyvalues:

  • Material: (Anything)

  • Strength: 0

  • Disable Shadows: Yes

  • Disable Receiving Shadows: Yes

  • Render Mode: Don't Render
 

tyler

aa
Sep 11, 2013
5,102
4,621
OK, actually, there's a gross and hacky solution here. This is bad for a bunch of reasons, but the main one would be that this would probably end up severely lagging your map in multiplayer servers due to the amount of info being tracked (depending on where it is and how it's used, I guess).

I really recommend not doing this though, unless it's for a trade/joke map.
 

Exactol

Certified Hammer Hacker
aa
Jul 11, 2013
421
537
The way I did it, which is the same as tyler I think, does not lag
 

tyler

aa
Sep 11, 2013
5,102
4,621
Like I said it depends on what you're doing--I guess I assumed it would be big and therefore unwieldy, but Exactol is right that depending on the implementation you go after it could work fine. Or if you tell us what you want to do, we might know a better way to accomplish it.
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
There's a solution to this in the third post of the thread, coltn
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
There's a solution to this in the third post of the thread, coltn
well then I guess I should go before I make a bigger fool of myself
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
I'm trying to make a security fence at the edge of the map not be possible to stand on, but still possible to be shot.
well I would look at how valve does their fences as such, but basically all fences have a solid mesh that stops just about everything, and to fix the not able to stand on top: use a player clip (just type clip into materials window, it should be the first one there) from the bottom of the fence (or top) and drag upwards to the skybox, so you don't get little nooks that players can stand on and exploit.
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
So you still want people to stand on the fence? Alright, good luck with what you do.
 

Yrr

An Actual Deer
aa
Sep 20, 2015
1,308
2,743
No, I put ramps so people slide off the top of the fence and can't stand on it.
People will surf those, you really need to clip it all the way to the ceiling.
 

MoonFox

L10: Glamorous Member
Mar 17, 2015
739
74
And to add in, it's actually best to go and ground floor up all the walls and structures with player clip, it's the best way to ensure no one can exploit, the only reason why you would not go from floor to sky: would be for ledges, small buildings/sheds, or out door structures anyone could theoretically get on
 

zahndah

professional letter
aa
Jul 4, 2015
721
642
You could disable collision on the fence prop and clip all the way down to the floor.
 

JMaxchill

L5: Dapper Member
Jan 21, 2015
215
69
You could disable collision on the fence prop and clip all the way down to the floor.
This is probably the cleanest way to do it. Fewer brushes and no ramps. I can't remember if that allows projectiles through, though