🛠️ Codex Durability
Codex Durability is a lightweight and reusable item durability system designed specifically for RedM servers.
It allows developers to add durability to tools, weapons, equipment, and other inventory items through simple server-side exports. Durability can be created, checked, and reduced from any compatible resource.
When an item reaches 0% durability, it is automatically removed from the player’s inventory.
⭐ Main Features
- Metadata-based item durability system
- Supports tools, weapons, equipment, and custom items
- Automatically initializes items with durability
- Configurable durability loss for every action
- Retrieve the current durability percentage
- Automatically removes broken items at 0%
- Player notification when an item breaks
- Simple server-side export integration
- Lightweight and optimized
- No additional SQL installation required
🔌 Developer-Friendly Exports
Create Durability
Initializes an item with durability.
exports['codex_durability']:CreateDurability(source, 'pickaxe')Remove Durability
Removes the specified durability amount from an item.
exports['codex_durability']:RemoveDurability(source, 'pickaxe', 5)When the durability reaches zero, the item is automatically removed.
Get Durability
Returns the item’s current durability value.
local durability = exports['codex_durability']:GetDurability(source, 'pickaxe')
print(('Current durability: %s%%'):format(durability))🎮 Perfect For
Codex Durability can be integrated into:
- Mining pickaxes
- Lumberjack axes
- Fishing equipment
- Weapons and weapon maintenance
- Crafting tools
- Farming equipment
- Ranch tools
- Lockpicks
- Criminal equipment
- Job-specific tools
- Gathering systems
- Custom inventory items
⚙️ How It Works
- A script initializes durability for an item.
- The player uses the item during an activity.
- The connected resource removes a configured durability amount.
- The current durability can be retrieved at any time.
- Once durability reaches 0%, the broken item is removed automatically.
📦 Technical Information
- Platform: RedM
- Lua Version: Lua 5.4
- Required Resource:
codex_core - Integration Type: Server-side exports
- Database Installation: No additional SQL required
- Included Functions: Create, retrieve, and remove durability
⚠️ Important Information
Codex Durability is an integration resource intended to work alongside other scripts.
It provides the durability functions needed for developers to implement item wear inside mining, crafting, gathering, weapon, job, and activity systems.

