PAYDAY 2

PAYDAY 2

View Stats:
Neo Feb 2 @ 10:29pm
How could I check which weapon type is currently used?
So I'm trying to use this mod: https://modworkshop.net/mod/39827
Turning off lasers when I aim.

However, I wanted to add a condition to make it NOT turn off the lasers if an LMG is the weapon being aimed down sight (to keep the laser on the LMG when aiming, since it doesnt really aim down sights)

I've been struggling more than I thought I would to find what to include for that, and I kinda assumed some much more experienced modders may have an easy go at this.
Originally posted by Dom:
Class RaycastWeaponBase has a handy function to check weapon type.
See RaycastWeaponBase:is_category(...).
In your case, modify line 21 and add and not wep_base:is_category("lmg") between is_gadget_on() and then.
Like this:
if wep_base:has_gadget() and wep_base:is_gadget_on() and not wep_base:is_category("lmg") then
< >
Showing 1-2 of 2 comments
The author of this thread has indicated that this post answers the original topic.
Dom Feb 3 @ 5:42am 
Class RaycastWeaponBase has a handy function to check weapon type.
See RaycastWeaponBase:is_category(...).
In your case, modify line 21 and add and not wep_base:is_category("lmg") between is_gadget_on() and then.
Like this:
if wep_base:has_gadget() and wep_base:is_gadget_on() and not wep_base:is_category("lmg") then
Last edited by Dom; Feb 3 @ 5:42am
Neo Feb 3 @ 6:31am 
Originally posted by Dom:
Class RaycastWeaponBase has a handy function to check weapon type.
See RaycastWeaponBase:is_category(...).
In your case, modify line 21 and add and not wep_base:is_category("lmg") between is_gadget_on() and then.
Like this:
if wep_base:has_gadget() and wep_base:is_gadget_on() and not wep_base:is_category("lmg") then
Oh thanks a lot, I'll have a look at that. I appreciate the help!
< >
Showing 1-2 of 2 comments
Per page: 1530 50