Skip to content

twinded_scope

A weapon scope attachment system for RedM. Players can attach and remove scopes on their weapons using inventory items, with animations and persistent storage.

Dependencies

ResourceRequiredNotes
vorp_coreYesFramework
vorp_inventoryYesInventory system
twinded_libsYesFree shared library
oxmysqlYesDatabase

Compatibility

VORP Framework only — this script reads directly from the VORP loadout table.

Installation

  1. Import the SQL file (sql.sql) to create scope items in your inventory database.

  2. Add to your server config:

bash
ensure twinded_libs
ensure twinded_scope

Config Files

FileDescription
settings.luaDebug mode, animation settings, scope items mapping, weapon definitions
lang.luaTranslation strings
sql.sqlSQL queries to insert scope items into your inventory

See the Configuration guide for how to override these files.

Configuration Reference

settings.lua

OptionTypeDefaultDescription
Config.DebugbooleanfalseEnable debug logging
Config.AnimationbooleantrueEnable/disable attachment animation
Config.Anim.AnimDictstring"mech_inspection@..."Animation dictionary
Config.Anim.AnimNamestring"aim_enter"Animation name
Config.Anim.AnimDurationnumber1500Animation duration (milliseconds)
Config.UseScopeItemsbooleantrueWhether scope items are consumed from inventory
Config.CloseInventorybooleantrueAuto-close inventory after scope action
Config.RemoveScopeWithCommandbooleantrueEnable the remove scope command
Config.RemoveScopeCommandstring"retirerlunette"Command to remove an attached scope
Config.RemoveScopeCooldownnumber5000Cooldown between removals (milliseconds)

Supported Weapons & Scopes

13 scope types across 8 weapon families (+ Carcano available by uncommenting):

WeaponScope Types
WinchesterShort
HenryShort
EvansShort
CarbineShort
VarmintShort, Medium
Bolt ActionShort, Medium
SpringfieldShort, Medium
Rolling BlockShort, Medium, Long

Carcano Support

Carcano scopes are included but commented out by default. Uncomment them in Config.ScopeItems and Config.Scopes to enable Short, Medium, and Long scopes for the Carcano.

Features

  • Inventory-based scopes — Attach scopes using items from your inventory
  • Animation system — Configurable animation when attaching/removing scopes
  • 13+ scope types — Short, medium, and long scopes across 8+ weapon families
  • Persistent storage — Scopes survive reconnections (stored in database)
  • Remove command/retirerlunette to remove an attached scope and get the item back
  • Third-party conflict detection — Detects scopes added by other scripts and prevents conflicts
  • Auto-close inventory — Configurable automatic inventory close after attachment
  • Cooldown system — Prevent spam with configurable cooldown
  • Server-side validation — Anti-exploit pending validation system with timeout

Troubleshooting

ProblemSolution
Script doesn't startMake sure twinded_libs and oxmysql are started before
Can't attach scopeVerify the weapon is in the supported list and you have the correct scope item
"Already installed" errorThe weapon already has a scope — remove it first with the command
Cooldown messageWait for the cooldown period to expire before retrying
Evans rifle scope not workingAfter attaching, holster and re-equip the weapon for it to take effect
Scope items not in inventoryImport the sql.sql file to create the items in your database

Premium RedM Scripts — Multi-Framework