twinded_collect
A versatile collection and 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 |
|---|---|---|
| twinded_libs | Yes | Free shared library |
Compatibility
Cross-framework — works with VORP, RSG, QBCore RedM, QRCore, RedEM:RP, RPX, TPZ-CORE, and FRP. Framework is auto-detected by twinded_libs.
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 | "default" | Progress bar system. 'default' uses the built-in twinded_libs bar, 'custom' uses your handler in progressbar.lua |
Config.InteractionDistance | number | 2.0 | Maximum distance (meters) to interact with a collection point |
Config.PropSpawnDistance | number | 30.0 | Distance (meters) at which dynamic props spawn |
Config.PropDespawnDistance | number | 50.0 | Distance (meters) at which dynamic props despawn |
Config.PropCheckInterval | number | 2000 | Interval (milliseconds) to check player distance for prop streaming |
Config.ModeleDetectionRadius | number | 1.75 | Radius (meters) for detecting model-based collection objects |
Config.ModeleCooldown | number | 5000 | Cooldown (milliseconds) between model-based collections per object |
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.Collect:
| Field | Type | Description |
|---|---|---|
name | string | Display name (used for blip label) |
blip | string or nil | Blip sprite identifier, or nil to hide from map |
blipScale | number | Blip size on the map (default: 0.6) |
label | string | Text shown on the interaction prompt |
items | table or nil | Items to give: { { item = "name", min = 1, max = 3 } } |
money | table or nil | Money reward instead of items: { amount = 0.3, type = "cash" } ("cash" or "gold") |
animation | table | Animation config: { dict = "...", anim = "...", time = 10000 } (time in ms) |
object | table or nil | Prop attached to player during animation: { name, offset = { male = {x,y,z,rx,ry,rz}, female = {...} }, bone } |
jobs | table or nil | Allowed jobs (nil or empty = everyone) |
positions | table | List of coordinates: { { x, y, z }, ... } |
prop | string or nil | Static prop model to spawn at each position |
Model-Based Collection
Each entry in Config.CollectModel:
| Field | Type | Description |
|---|---|---|
label | string | Text shown on the interaction prompt |
models | table | List of model hashes to detect (backtick syntax) |
items | table | Items to give: { { item = "name", min = 1, max = 3 } } |
animation | table | Animation config: { dict = "...", anim = "...", time = 3100 } |
jobs | table or nil | Allowed jobs (nil or empty = everyone) |
progressbar.lua
Only used when Config.ProgressBar = 'custom'. Handle the event:
lua
RegisterNetEvent('twinded_collect:customProgressBar', function(anim_data, time, items, money, collect_index, collect_type)
-- Start your progress bar here
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 or custom handler
- Rate limiting — Server-side anti-exploit protection
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 |
| Items not given | Verify item names match your inventory database exactly |

