[STANDALONE] Weapon Scope Glint

:telescope: Weapon Scope Glint

This FiveM resource adds a dynamic and customizable sniper scope glint to scoped weapons - just like in popular shooters. When players aim down sights with a high-powered optic, a realistic lens flare / sniper glint appears, making long-range engagements more tactical and fair.

:shopping_cart: Get it here: gamzkystore.com

:question: Support: Discord

:movie_camera: Detailed preview: Youtube

Features

  • Realistic scope glint effect: A visible glint is shown when players or NPCs aim down sights with scoped weapons.
  • Fully standalone: No framework required - works out of the box with any server setup (ESX, QBCore, or custom).
  • Sprite & corona modes: Choose between sprite-based glint or a light-based corona effect.
  • Day/Night awareness: Automatically disables glint during nighttime hours for realism (configurable).
  • Distance-based visibility: Glint appears only within configurable minimum and maximum range values.
  • Field of view control: Adjust the angular visibility cone for glint detection (default: 20Β°).
  • Dynamic intensity: Smooth fading at the edge of visibility for realistic transitions based on view angle.
  • Configurable scope components: Easily define which weapon components trigger the glint.
  • Optimized performance: Clean, efficient design with low resource usage and intelligent draw checks.
  • Built-in debug tools: Visualize glint field, LOS, and detection logic using included test NPCs and debug lines.

Resmon: Idle: 0.00ms - Active: 0.02ms

Config
Config = {
    minimumGlintDistance = 10,   -- The minimum distance at which the scope glint will appear, being closer too close to the scope will not show the glint.
    maximumGlintDistance = 1000, -- The maximum distance at which the scope glint will appear, being further away from the scope will not show the glint. (can be limited to 400 for networked entities)
    glintFieldOfView = 20,       -- The field of view in which the scope glint will be visible (degrees)
    disableDuringNight = true,   -- Disable the scope glint during night time.
}

-- The sprite method uses a sprite to create the scope glint, this is the default method used in the video showcase.
Config.Sprite = {
    enabled = true,                                -- Enable or disable the sprite method for the scope glint. (this is the default method)
    glintSize = 1.0,                               -- The size of the sprite glint.
    rgba = { r = 255, g = 255, b = 255, a = 255 }, -- The rgba values for the sprite glint.
}

-- The corona method uses a lighting effect (corona) to create the scope glint and can have a more realistic appearance. Feel free to try it out, you can also enable both methods at the same time if you wish to.
Config.Corona = {
    enabled = false,                               -- Enable or disable the corona method for the scope glint.
    glintSize = 1.0,                               -- The size of the corona glint.
    glintIntensity = { 5.0, 0.05 },                -- The intensity of the glint during the day and during the night. You can tweak these values to increase or decrease the intensity of the glint depending on the time of day.
    edgeIntensityThreshold = 25,                   -- The threshold for the intensity of the glint when on the edge of the scope's field of view. Increasing this values will make the glint appear and dissapear more smoothly.
    rgba = { r = 255, g = 255, b = 255, a = 255 }, -- The rgba values for the corona glint.
}

-- All the components in this list will have the scope glint applied to them.
Config.GlintComponents = {
    [`COMPONENT_AT_SCOPE_MACRO`] = true,
    [`COMPONENT_AT_SCOPE_SMALL`] = true,
    [`COMPONENT_AT_SCOPE_MACRO_MK2`] = true,
    [`COMPONENT_AT_SCOPE_MEDIUM_MK2`] = true,
    [`COMPONENT_AT_SCOPE_MACRO_02_MK2`] = true,
    [`COMPONENT_AT_SCOPE_SMALL_MK2`] = true,
    [`COMPONENT_AT_SCOPE_MEDIUM`] = true,
    [`COMPONENT_AT_SCOPE_LARGE`] = true,
    [`COMPONENT_AT_SCOPE_MAX`] = true,
    [`COMPONENT_AT_SCOPE_LARGE_MK2`] = true,
    [`COMPONENT_AT_SCOPE_NV`] = true,
    [`COMPONENT_AT_SCOPE_THERMAL`] = true,
    [`COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM`] = true,
    [`COMPONENT_AT_SCOPE_LARGE_FIXED_ZOOM_MK2`] = true,
    [`COMPONENT_AT_SCOPE_SMALL_02`] = true,
    [`COMPONENT_AT_SCOPE_MACRO_02`] = true,
    [`COMPONENT_AT_SCOPE_MACRO_02_SMG_MK2`] = true,
    [`COMPONENT_AT_SCOPE_SMALL_SMG_MK2`] = true,
}

-- A debug mode, usefull to test the scope glint on your own if you wish to tweak the configuration to your liking.
Debug = {
    enabled = false, -- Enables debug mode, will draw lines to the scope and camera to test if the scope is in view. The peds in the list below will also be created.
    pedLocations = { -- Will create a ped with a weapon at the given coordinates, who will be aiming at the given aimCoords.
        {
            weapon = `weapon_sniperrifle`,
            coords = vector4(-1795.26, -2772.01, 22.23, 314.95),
            aimCoords = vector3(-1304.82, -2159.91, 13.94),
        },
        {
            weapon = `weapon_heavysniper`,
            coords = vector4(-1340.00, -2602.91, 31.59, 15.80),
            aimCoords = vector3(-1304.82, -2159.91, 13.94),
        },
        {
            weapon = `weapon_marksmanrifle`,
            coords = vector4(-1739.84, -2912.85, 12.94, 329.96),
            aimCoords = vector3(-1304.82, -2159.91, 13.94),
        }
    }
}

Code is accessible No, but there is an unencrypted version
Subscription-based No
Lines (approximately) 510
Requirements No, fully standalone
Support Yes
3 Likes

warzone ptsd coming to fivem…

nice release

2 Likes

nice work bro

1 Like

Thanks!

Good work guys, always new ideas. love it! <3

1 Like

Nice resource, but a bit unoptimized when in use, more like 0.07 when in use.

It really depends on the PC setup you are using. For me it’s 0.02ms