Left 4 Dead 2

Left 4 Dead 2

View Stats:
This topic has been locked
Spawning Laser Sight Box?
I'm aware that you can add a sight to the current weapon but I'm trying to find out how to address a laser sight box..

So the line in my Vscript goes

weaponsToConvert =

{
weapon_defibrillator = "weapon_laser_sight_spawn"
}

The above name is just a guess.. I want to know what the actual name is for the laser sight box.

Much appreciated!
< >
Showing 1-3 of 3 comments
Rectus Oct 14, 2014 @ 3:09am 
The actual laser sight box uses the upgrade_laser_sight entity. I'm not sure if it's possible to spawn directly though, since it's normally spawned by a upgrade_spawn in the map.
Last edited by Rectus; Oct 14, 2014 @ 3:10am
SickHead Jul 20, 2019 @ 8:26pm 
Just use ent_create upgrade_laser_sight
Rayman1103 Jul 20, 2019 @ 9:14pm 
Please don't bump old topics. I'm locking this thread to prevent further bumps.

To answer the question for anyone else that may want to know, this is the VScript code you can use:

local defib = null; while ( defib = Entities.FindByClassname( defib, "weapon_defibrillator_spawn" ) ) { if ( defib.IsValid() ) { local keyValues = { targetname = "new_laser_sight", origin = defib.GetOrigin(), angles = Vector(0, 0, 0), } defib.Kill(); local ent = SpawnEntityFromTable( "upgrade_laser_sight", keyValues ); } }
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Oct 13, 2014 @ 5:17pm
Posts: 3