This tutorial is going to show you how to strip a weapon from a player who isn't supposed to pick it up.
This tutorial was spawned as I could not find any decent information on how to weapon strip players for my Marines Vs Predators map prefab, so I decided to play around a bit.
This only works on map weapons (weapon_ entities that you place in the map yourself). It will also work with weapon spawners if you add the output on the weapon being spawned.
How to do it
You want to create the following entities. I will use my naming structure in this tutorial but you can use your own if you like.
- (Name: No name) Weapon entity (like weapon_m4a1)
- (Name: TWeaponFilter) filter_activator_team (or filter_activator_name if you want it limited to a Targetname)
- (Name: KnifeSpawner) game_player_equip (Flags: Use Only and Strip All Weapons First ticked)
No adjustments to the Class Info required.
In the Flags Tab:
- Tick Use Only and Strip All Weapons First.