MX-collectsap (MX-FarmSap)
Discord: Mexicano Scripts
Preview: https://youtu.be/6aOrJsbG5cY
Tebex: https://mexicano-scripts.tebex.io/category/3257636
MX-collectsap is a RedM script for collecting tree sap. Players use ox_target on supported tree models to place a bucket, wait while it fills, then collect rewards. The resource targets VORP and RSG (auto-detection via vorp_inventory / rsg-core). Server logic and events use the prefix mx_farmsap. —
What it does
Players need a hatchet and an empty bucket in inventory. Outside restricted towns, they can place one bucket per character; the prop persists in MySQL through oxmysql. A timer (Config.BucketFillTime, default five minutes) controls when collection is allowed. After pickup, the server rolls a chance (Config.ChanceRange and Config.Items) to grant sap or related items. The same tree position enters a cooldown so it cannot be spammed. Floating text shows time remaining or when the bucket is ready. Translations live in shared/translation.lua; set Lang in config.lua (e.g. English, Portugues_BR). —
Requirements
- oxmysql, ox_lib, ox_target
- vorp_core + vorp_inventory or rsg-core + rsg-inventory
- Items registered for bucket, axe, and rewards (names must match
config.luaor*VORP/*RSGoverrides).
—
Installation
- Import
sql/placements.sqlto createmx_farmsap.
- If you already have the table with
charidentifieras INT, runsql/migration_rsg.sqlso the column isVARCHAR(64)(needed for stable IDs on both frameworks).
- Align item names in
config.lua(bucket defaults tosap, axe tohatchet— adjust to your server).
- In
server.cfg, start dependencies first, then e.g.ensure MX-collectsapusing your folder name.
—
Configuration (essentials)
-
Config.Framework:auto,vorp, orrsg.
-
Config.BucketFillTime/Config.CoolDown: fill duration and per-tree cooldown (seconds).
-
Config.TownRestrictions: towns where placement is blocked (native town check).
-
Config.Trees: long list of model names for valid trees — add/remove only if you know the prop names.
-
Config.Items: reward lines withname,label,chance,amount; optionalConfig.ItemsVORP/Config.ItemsRSGfor split setups.
Tweak PromptDistance, BucketPlacementDistance, and LabelDrawDistance if prompts or the 3D label feel too close or far. —
Behaviour notes
Only one bucket placement is stored per character in the database. Reconnecting reloads the bucket client-side. The server removes the bucket item when placed and grants items only when the player collects after the timer; inventory full and failed chance paths are handled with notify messages. If placement fails with “invalid character” errors, check database column types and that the framework returns a valid character id. —
Troubleshooting (short)
-
No target on trees: ensure
ox_targetis running and the tree model is listed inConfig.Trees.
-
Wrong town blocking: verify town names in
townRestrictionsmatch your map expectations.
-
No rewards: check
ChanceRange, itemchancevalues, and carry limits in your inventory.
—