twinded_weapon_autoreload
An automatic weapon reload script for RedM. Automatically reloads weapons from ammo boxes in the player's inventory when the magazine is empty.
Dependencies
| Resource | Required | Notes |
|---|---|---|
| vorp_core | Yes | Framework |
| vorp_inventory | Yes | Inventory system |
| twinded_libs | Yes | Free shared library |
Compatibility
VORP Framework only — this script uses the VORP ammo API for bullet management.
Installation
bash
ensure twinded_libs
ensure twinded_weapon_autoreloadConfig Files
| File | Description |
|---|---|
settings.lua | Debug mode, check interval, weapon list with ammo types |
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.CheckInterval | number | 1000 | How often to check ammo (milliseconds) |
Weapon List
Each weapon entry in Config.Weapons has:
| Field | Type | Description |
|---|---|---|
weapon | string | Weapon name (e.g., "WEAPON_REVOLVER_CATTLEMAN") |
item | string or table | Inventory item name for ammo box. Table for dual-ammo weapons |
type | string or table | Ammo type hash. Table for dual-ammo weapons |
amount | number | Ammo per reload |
Supported Weapons (29 total)
| Category | Count | Examples |
|---|---|---|
| Revolvers | 9 | Cattleman, Schofield, Navy, Double Action, LeMat (dual-ammo) |
| Pistols | 4 | Volcanic, Mauser, Semi-Auto, M1899 |
| Rifles | 4 | Bolt Action, Springfield, Varmint, Elephant |
| Snipers | 2 | Rolling Block, Carcano |
| Shotguns | 6 | Double Barrel, Double Barrel Exotic, Pump, Repeating, Semi-Auto, Sawed-Off |
| Repeaters | 4 | Evans, Henry, Carbine, Winchester |
Dual-Ammo Example (LeMat Revolver)
The LeMat revolver uses both revolver and shotgun ammo:
lua
{
weapon = "WEAPON_REVOLVER_LEMAT",
item = { "ammorevolvernormal", "ammoshotgunnormal" },
type = { "AMMO_REVOLVER", "AMMO_SHOTGUN" },
amount = 12,
}Features
- Automatic reload — Ammo boxes from inventory are consumed to reload weapons automatically
- 29 pre-configured weapons — Revolvers, pistols, rifles, snipers, shotguns, repeaters
- Dual-ammo support — Weapons like the LeMat revolver that use two ammo types
- Configurable interval — Adjust how often the script checks for empty weapons
- Server-side validation — Rate limiting and weapon hash verification to prevent exploitation
- Lightweight — Client sends only the weapon hash, server handles all logic
Troubleshooting
| Problem | Solution |
|---|---|
| Script doesn't start | Make sure twinded_libs is started before |
| Weapon not reloading | Check the weapon is in Config.Weapons list and ammo item name matches your inventory |
| Ammo not consumed | Verify the item field matches the exact inventory item name |
| Performance concerns | Increase Config.CheckInterval (e.g., 2000 for 2 seconds) |

