Jump to content
Sign in to follow this  
Alpine_gremlin

Adding Flashlight to a Weapon not Configured for It

Recommended Posts

Hi guys. I am currently working on a mission where I want to give the players M16A2s (NIArms or 3CB assets), but I would also like to give them a mounted flashlight since it is a night mission. Unfortunately, these models don`t have a rail system and therefore cannot mount said flashlights. Is there a way to give the rifle the ability to mount a light without creating a new asset?

 

Thanks

Share this post


Link to post
Share on other sites

Hey!
Until someone come up with a more elegant solution, you can use the code bellow to add a grotesque portable Flashlight attached to the player 😁
If you use "rightHand" instead of "head", for instance (because that way the huge flashlight would be closer to the weapon), then change "true" for "false" in the last param, which defines whether the "flashlight" should rotate with the part it's attached to or not.

 

		_objectFrontRightLamp = "Land_PortableLight_02_single_folded_olive_F" createVehicle [0, 0, 0];
		_objectFrontRightLamp attachTo [player, [0, 0, 0], "head", true];
		_objectFrontRightLamp setVariable ['QS_attached',true,!is3DEN];
		_objectFrontRightLamp setDir 180;



Or maybe you decide to go even further and add some robocop lights 😂:
 

		_objectFrontRightLamp = "Land_PortableLight_02_single_folded_olive_F" createVehicle [0, 0, 0];
		_objectFrontRightLamp attachTo [player, [0, 0.02, 0.07], "rightFoot", true];
		_objectFrontRightLamp setVariable ['QS_attached',true,!is3DEN];
		_objectFrontRightLamp setDir 180;
		_objectFrontLeftLamp = "Land_PortableLight_02_single_folded_olive_F" createVehicle [0, 0, 0];
		_objectFrontLeftLamp attachTo [player, [0, 0.02, 0.07], "leftFoot", true];
		_objectFrontLeftLamp setVariable ['QS_attached',true,!is3DEN];
		_objectFrontLeftLamp setDir 180;

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×