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
| Resource | Required | Notes |
|---|---|---|
| vorp_core | Yes | Framework |
| vorp_inventory | Yes | Inventory system |
| twinded_libs | Yes | Free shared library |
| oxmysql | Yes | Database |
Compatibility
VORP Framework only — this script reads directly from the VORP loadout table.
Installation
Import the SQL file (
sql.sql) to create scope items in your inventory database.Add to your server config:
bash
ensure twinded_libs
ensure twinded_scopeConfig Files
| File | Description |
|---|---|
settings.lua | Debug mode, animation settings, scope items mapping, weapon definitions |
lang.lua | Translation strings |
sql.sql | SQL queries to insert scope items into your inventory |
See the Configuration guide for how to override these files.
Configuration Reference
settings.lua
| Option | Type | Default | Description |
|---|---|---|---|
Config.Debug | boolean | false | Enable debug logging |
Config.Animation | boolean | true | Enable/disable attachment animation |
Config.Anim.AnimDict | string | "mech_inspection@..." | Animation dictionary |
Config.Anim.AnimName | string | "aim_enter" | Animation name |
Config.Anim.AnimDuration | number | 1500 | Animation duration (milliseconds) |
Config.UseScopeItems | boolean | true | Whether scope items are consumed from inventory |
Config.CloseInventory | boolean | true | Auto-close inventory after scope action |
Config.RemoveScopeWithCommand | boolean | true | Enable the remove scope command |
Config.RemoveScopeCommand | string | "retirerlunette" | Command to remove an attached scope |
Config.RemoveScopeCooldown | number | 5000 | Cooldown between removals (milliseconds) |
Supported Weapons & Scopes
13 scope types across 8 weapon families (+ Carcano available by uncommenting):
| Weapon | Scope Types |
|---|---|
| Winchester | Short |
| Henry | Short |
| Evans | Short |
| Carbine | Short |
| Varmint | Short, Medium |
| Bolt Action | Short, Medium |
| Springfield | Short, Medium |
| Rolling Block | Short, 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 —
/retirerlunetteto 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
| Problem | Solution |
|---|---|
| Script doesn't start | Make sure twinded_libs and oxmysql are started before |
| Can't attach scope | Verify the weapon is in the supported list and you have the correct scope item |
| "Already installed" error | The weapon already has a scope — remove it first with the command |
| Cooldown message | Wait for the cooldown period to expire before retrying |
| Evans rifle scope not working | After attaching, holster and re-equip the weapon for it to take effect |
| Scope items not in inventory | Import the sql.sql file to create the items in your database |

