Skip to content

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

ResourceRequiredNotes
vorp_coreYesFramework
vorp_inventoryYesInventory system
vorp_progressbarYesOr use 'custom' handler
twinded_libsYesFree shared library

Installation

bash
ensure twinded_libs
ensure twinded_collect

Config Files

FileDescription
settings.luaMain settings, collection points, model-based collection
lang.luaTranslation strings
progressbar.luaCustom progress bar handler (when Config.ProgressBar = 'custom')
webhook.luaCustom webhook handler (when Config.Webhook.type = 'custom')

See the Configuration guide for how to override these files.

Configuration Reference

settings.lua

OptionTypeDefaultDescription
Config.ProgressBarstring"vorp_progressbar"Progress bar resource. Set to 'custom' to use your own handler in progressbar.lua
Config.InteractionDistancenumber2.0Maximum distance (meters) to interact with a collection point
Config.PropSpawnDistancenumber30Distance (meters) at which dynamic props spawn
Config.PropDespawnDistancenumber50Distance (meters) at which dynamic props despawn
Config.ModelDetectionRadiusnumber1.75Radius (meters) for detecting model-based collection objects
Config.ModelDetectionCooldownnumber5Cooldown (seconds) between model-based collections
Config.Webhook.typestring"discord"'discord' for built-in Discord embeds, 'custom' for your own handler
Config.Webhook.urlstring""Discord webhook URL (only used with 'discord' type)

Collection Point Fields

Each entry in Config.CollectionPoints:

FieldTypeDescription
coordsvector3World position of the collection point
jobstable or nilAllowed jobs (nil = everyone)
itemstringItem to give on collection
amountnumberAmount of items to give
durationnumberCollection duration (milliseconds)
anim_dictstringAnimation dictionary
anim_namestringAnimation name
propstring or nilDynamic prop model to spawn at location
held_proptable or nilProp attached to player during animation ({model, offset, bone})
bliptable or nilMap blip config ({sprite, color, label})
moneytable or nilMoney 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

ProblemSolution
Script doesn't startMake sure twinded_libs is started before twinded_collect
No blips on mapCheck that blip is set in collection point config (not nil)
Can't interactVerify Config.InteractionDistance and player job matches jobs list
Props not spawningCheck Config.PropSpawnDistance and prop field in collection config

Premium RedM Scripts for VORP Framework