Laser Sight + Flash Light Combo With Infrared Night Vision Logic - JaysWeaponLightSights (v3.x)

A realistic and accurate Laser Sight + Flash Light combo script resource that is well/accurately synced between players - JaysWeaponLightSights (v3.x)

Contains several realistic dynamics -

  • If/When you are aiming around a corner or a wall (or an object or whatever else), your laser is likely to become obstructed by these if your shot is likely to hit them instead of your target, rather than always passing through them and going onto your target.
  • Lasers penetrate and pass through glass.
  • Lasers can not be seen by you when you are using “see-through” (thermal/heat) vision.
  • Lasers have two distinct modes and colors -
    • Laser “default” mode color has been changed from green to red (from version 1.x to version 2.x)
    • Laser “infrared” mode color is green and can only be seen by you when you are using night vision
      • Laser “infrared” mode is automatically activated and deactivated when you use night vision.

Has 4 independent light sight states (per weapon) at this time, toggled via your normal/default weapon flashlight toggle button (your weapon must have a flashlight component/attachment on it in order for any of this to work by the way) -

  • Off
  • Laser Only (Default/Infrared)
  • Laser (Default/Infrared) + Flashlight
  • Flashlight Only

It does also support custom weapons (although certain custom weapons will need to have an entry for their particular component to be added into the fxmanifest.lua to be usable/recognized; a template for how to do this is already included inside if needed/necessary).

Showcases:

Where:
https://jaymontana36.tebex.io/package/5861259

Code is accessible No
Subscription-based No
Lines (approximately) 356
Requirements A flashlight attachment/component on the weapon
Support No

Dose it work on all weapons and how do you install it on your weapon ?

It works for any/all weapons that have a flashlight attachment/component installed on them; the script will not automatically put these onto your weapons for you.

ExampleA: vMenu - Give yourself a weapon, and make sure you add the flashlight attachment/component.
ExampleB: Some other weapon management script for frameworks supporting attachments/components, make sure you’re able to add the flashlight attachment/component to your weapon with it.

Then, use whatever button/key you have mapped for your weapon flashlight to enable/disable the laser and flashlight (this is “INPUT_WEAPON_SPECIAL_TWO” which on controller is “DPAD RIGHT” and on keyboard is “E” by default)

Thats Dope, thank you.

im trying with esx and ox, and cant get the laser to turn on.

Do you have a flashlight component/attachment on the weapon?

Captur323e

I’ve just re-uploaded it again, try re-downloading the new version (zip file now tagged v2r2 instead of just v2), I don’t know what happened with the first but this one does work now.

1 Like

appreciate it, im checking rn

works!!

No problem lol, sorry it didn’t just work the first time around but glad a simple re-upload fixed it

To those who’ve purchased and downloaded, this has received a few updates since then!

Changes made since the original publication/posting:

  • Lasers/Flashlights now also aim/point accurately when “blind-firing” from behind cover
  • Mitigated against most scenarios where the laser/flashlight could be pointed/aimed in a way that makes no sense (and should not be possible)
  • Fixed a(n) issue/bug where weapons without a flashlight component/attachment could still use lasers and flashlights
  • Properly/Fully integrate and optimize the above fix (faster execution via less work)
  • Implement caching for certain internals (faster execution via remembering aka less work)
  • Restructured internal light modes and toggles (more efficient toggle code)
  • Simplified and removed excess logic (clean up and optimize remaining code)

Addon weapons other than replacement weapons don’t work?

It would be nice to make a config so that addon weapons can also be used

Addon/Custom weapons can and do work perfectly fine, assuming that they were modeled and configured “correctly” just as the default/R* weapons are (requirements are exactly the same no matter the weapon):

  • Weapon Model:
    • Has a flashlight and/or laser bone
  • Weapon Files/Metas:
    • Declares to the game that this weapon has and supports a flashlight component
  • Weapon In-Game:
    • Has the flashlight component equipped

The flashlight part is also an add-on. Does it still work?

Yes, if in the base game (non-scripted) you are able to use the default game flashlight on a particular weapon (because it has a flashlight bone as well as a flashlight component), then it will work, since what this basically does is override/emulate/replace the base game’s handler logic for flashlights, from having only just the base game’s flashlight mechanics, to now having custom laser and flashlight mechanics instead.

Did you manage to confirm the details of your addon weapon’s model (whether it has a flashlight bone and a flashlight component) and/or your addon weapon’s meta data files (whether it declares to the game that this weapon has/supports flashlight)? If not, then I would like to take a look to try and see what might be wrong about your addon weapon in question.

Here is an example video regarding how the lasers/flashlights work (or are supported) on weapons, when they have all of the correct properties associated with them in their models and metas.

Tag your friends on Discord and we’ll let you know

What do you mean?