From Valve Developer Community
Jump to: navigation, search

<Left 4 Dead 2> weapon_spawn is a point entity available in Left 4 Dead 2. It is a configurable spawner for any non-melee weapon.


Selection <choices>
Spawn the selected weapon or weapon category
Value Description
any Any primary or secondary weapon
any_pistol Any Pistol
weapon_pistol Pistol
weapon_pistol_magnum Magnum Pistol
any_primary Any Primary Weapon
tier1_any Any tier 1 primary
tier2_any Any tier 2 primary
any_smg Any tier 1 SMG
any_rifle Any tier 2 Rifle
any_sniper_rifle Any tier 2 Sniper Rifle
any_shotgun Any Shotgun
tier1_shotgun Any tier 1 Shotgun
tier2_shotgun Any tier 2 Shotgun
weapon_smg SMG
weapon_smg_silenced Silenced SMG
weapon_pumpshotgun Pump Shotgun
weapon_shotgun_chrome Chrome Shotgun
weapon_autoshotgun Auto Shotgun
weapon_shotgun_spas SPAS Shotgun
weapon_rifle M4 Rifle
weapon_rifle_desert Desert Rifle
weapon_rifle_ak47 AK47
weapon_hunting_rifle Hunting Rifle
weapon_sniper_military Sniper Military
weapon_smg_mp5 MP5
weapon_rifle_sg552 SG552
weapon_sniper_awp Sniper AWP
weapon_sniper_scout Sniper Scout
Spawn instantly without director <boolean>
Bypass the proximity checks that make nearby weapons be the same tier / not the same weapon
No CS Weapons <boolean>
When selecting 'any' weapon, set this to true if you do not want CS weapons.


Count <integer>
Max number of weapons given before disappearing.


Weapon Skin <integer>
Some weapons have multiple versions of their textures, called skins. Set this to a number other than -1 to make the given weapon use that skin instead of the default.
Glow Range <float>
Set a custom glow range for this spawner. 0 means use the default range.
Collisions <choices>
Collision box type.
  • 0 : Not Solid
  • 2 : Use Bounding Box
  • 6 : Use VPhysics


Parent (parentname) <targetname>
Specifies a movement parent. An entity will maintain its initial offset from its parent. An attachment point can be added to the end of the name, separated by a comma.


Global Entity Name <string>
Name by which this entity is linked to another entity in a different map. When the player transitions to a new map, entities in the new map with globalnames matching entities in the previous map will have the previous map's state copied over their state.


Name (targetname) <string>
The targetname that other entities refer to this entity by.
Entity Scripts (vscripts) <scriptlist> (in all games since <Left 4 Dead 2>)
Space delimited list of VScript files (without file extension) that are executed after all entities have spawned. The scripts are all executed in the same script scope, later ones overwriting any identical variables and functions.
Script think function (thinkfunction) <string> (in all games since <Left 4 Dead 2>)
Name of a function in this entity's script which will be called automatically every 100 milliseconds (ten times a second) for the duration of the script. It can be used to create timers or to simulate autonomous behavior. The return value (if present) will set the time until the next call.
Note.png Note: Try to avoid expensive operations in this function, as it may cause performance problems.


Pitch Yaw Roll (Y Z X) (angles) <angle>
This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.


World Model (model) <string>
The model this entity should appear as. 128-character limit.
Skin (skin) <integer>
Some models have multiple skins. This value selects from the index, starting with 0.
Tip.png Tip: Hammer's model browser automatically updates this value if you use it to view different skins.
Model Scale (modelscale) <float> (in all games since <Source><Source>)
A multiplier for the size of the model.


Disable Shadows (disableshadows) <boolean>
Prevents the entity from creating cheap render-to-texture shadows, or lightmap shadows if the entity is a prop_static. Does not affect shadow mapping.
Disable ShadowDepth (disableshadowdepth) <boolean> (in all games since [Portal 2])
Used to disable rendering into shadow depth (for projected textures) for this entity.
Projected Texture Cache (shadowdepthnocache) <choices> (in all games since [Portal 2])
Used to hint projected texture system whether it is sufficient to cache shadow volume of this entity or to force render it every frame instead.
  • 0 : Default
  • 1 : No cache - render every frame
  • 2 : Cache it - render only once
Disable flashlight (disableflashlight) <boolean> (in all games since [Portal 2])
Used to disable projected texture lighting and shadows on this entity.


Render in Fast Reflections (drawinfastreflection) <boolean> (in all games since [Portal 2])
If enabled, this entity will render in fast water reflections (i.e. when a water material specifies $reflectonlymarkedentities) and in the world impostor pass.


  • 16 : Constrain to spawn position (don't drop to the ground)


  • 4 : Absorb any dropped weapon type


  • 1 : Enable Physics
  • 2 : Must Exist
  • 8 : Infinite items (overrides count)