twinded_collect
A versatile collection/farming script for RedM. Supports position-based and model-based (native world objects) collection with job restrictions, custom animations, attached props, and money rewards.
Dependencies
| Resource | Required | Notes |
|---|---|---|
| vorp_core | Yes | Framework |
| vorp_inventory | Yes | Inventory system |
| vorp_progressbar | Yes | Or use 'custom' handler |
| twinded_libs | Yes | Free shared library |
Installation
bash
ensure twinded_libs
ensure twinded_collectConfig Files
| File | Description |
|---|---|
settings.lua | Main settings, collection points, model-based collection |
lang.lua | Translation strings |
progressbar.lua | Custom progress bar handler (when Config.ProgressBar = 'custom') |
webhook.lua | Custom webhook handler (when Config.Webhook.type = 'custom') |
See the Configuration guide for how to override these files.
Configuration Reference
settings.lua
| Option | Type | Default | Description |
|---|---|---|---|
Config.ProgressBar | string | "vorp_progressbar" | Progress bar resource. Set to 'custom' to use your own handler in progressbar.lua |
Config.InteractionDistance | number | 2.0 | Maximum distance (meters) to interact with a collection point |
Config.PropSpawnDistance | number | 30 | Distance (meters) at which dynamic props spawn |
Config.PropDespawnDistance | number | 50 | Distance (meters) at which dynamic props despawn |
Config.ModelDetectionRadius | number | 1.75 | Radius (meters) for detecting model-based collection objects |
Config.ModelDetectionCooldown | number | 5 | Cooldown (seconds) between model-based collections |
Config.Webhook.type | string | "discord" | 'discord' for built-in Discord embeds, 'custom' for your own handler |
Config.Webhook.url | string | "" | Discord webhook URL (only used with 'discord' type) |
Collection Point Fields
Each entry in Config.CollectionPoints:
| Field | Type | Description |
|---|---|---|
coords | vector3 | World position of the collection point |
jobs | table or nil | Allowed jobs (nil = everyone) |
item | string | Item to give on collection |
amount | number | Amount of items to give |
duration | number | Collection duration (milliseconds) |
anim_dict | string | Animation dictionary |
anim_name | string | Animation name |
prop | string or nil | Dynamic prop model to spawn at location |
held_prop | table or nil | Prop attached to player during animation ({model, offset, bone}) |
blip | table or nil | Map blip config ({sprite, color, label}) |
money | table or nil | Money reward instead of item ({type = "cash"/"gold", amount}) |
progressbar.lua
Only used when Config.ProgressBar = 'custom'. Implement your own progress bar by handling the event:
lua
RegisterNetEvent('twinded_collect:customProgressbar', function(duration, label, cb)
-- Start your progress bar here
-- Call cb(true) on complete, cb(false) on cancel
end)Features
- Position-based collection — Define spots on the map with coordinates
- Model-based collection — Harvest native world objects (plants, cacti, etc.) by proximity
- Job restrictions — Restrict collection points to specific jobs
- Custom animations — Per-collection-point animation with optional held props (axe, pickaxe, pan...)
- Money rewards — Award cash or gold instead of items
- Dynamic prop streaming — Props spawn/despawn based on player distance
- Webhook logging — Discord logging via twinded_libs, or use your own custom handler
- Native notifications — Uses RedM native notification system via twinded_libs
Troubleshooting
| Problem | Solution |
|---|---|
| Script doesn't start | Make sure twinded_libs is started before twinded_collect |
| No blips on map | Check that blip is set in collection point config (not nil) |
| Can't interact | Verify Config.InteractionDistance and player job matches jobs list |
| Props not spawning | Check Config.PropSpawnDistance and prop field in collection config |

