πΏ RDE FARMING | Dynamic Resource Gathering for FiveM ox_core | Full In-Game Admin CRUD | Proximity Prop Streaming | StateBag Sync | Tool Requirements | Animations | Auto-Respawn | Production-Ready
Built by Red Dragon Elite | Free Forever | No Paywalls | No Legacy
π Installation β’ βοΈ Configuration β’ π¬ Animations β’ π Locales β’ π‘ Events β’ π Troubleshooting β’ π Website
Every other farming resource ships with hardcoded coordinates in a config file, 50 dependencies, and zero flexibility. Want to add a new mining spot? Edit Lua, restart server, pray. Want to move a spot? Same pain.
We said no.
| β Other Farming Scripts | β rde_farming |
|---|---|
| Coords hardcoded in config | 100% dynamic β all areas & spots live in the DB |
| Restart required to add spots | In-game Admin CRUD β create, edit, move, delete, toggle live |
| All props always loaded | Proximity streaming β props only exist within 150m |
| One animation fits all | 10 built-in animation keys, all customizable, fully extensible |
| No tool requirement | Per-area tool item required to harvest (or none at all) |
| Instant respawn | Configurable respawn timer per area, server-scheduled |
| No anti-exploit | Rate limiting, distance validation, server-side inventory give |
| One language | EN / DE out of the box, add more in minutes |
| ESX / QBCore bloat | ox_core native β clean, modern, fast |
- πΏ Fully Dynamic Areas β every farming area is created and managed in-game via the admin menu. No config restarts ever
- π Proximity Prop Streaming β resource props only spawn clientside within
Config.LoadRadius(default 150m). Hysteresis band prevents pop-in. Zero network overhead for distant spots - π‘ StateBag Sync β
GlobalState[rde_farm_area_*]andGlobalState[rde_farm_spot_*]keep every client in sync in real time. New players joining mid-session get the full state immediately - π¬ Animation Library β 10 pre-built harvest animations (pickaxe, axe, shovel, hands, knife, crouch, fish, bottle, plant, hammer). Admin picks a key. Add your own freely in
data/animations.lua - π§ Tool Requirements β each area can require a specific
ox_inventoryitem. No item = blocked with a notification. Optional β leave blank for no requirement - π Tool Hand Props β while harvesting, a 3D prop attaches to the player's right hand bone. Per-animation, or overridden per-area. Full offset & rotation control
- π Auto-Respawn β depleted spots are queued server-side with a per-area timer. Spot goes ghosted/transparent on depletion, disappears, reappears on respawn
- π² Random Gather Amounts β configurable min/max per area. Each harvest rolls in that range
- ποΈ Admin CRUD β in-game menu for create / edit / move center / toggle active / delete areas. No
/setcoordsnonsense β stand where you want and confirm - π Dual Permission System β ACE permission + ox_core group check. Configurable
- π‘οΈ Anti-Exploit β server-side distance validation, per-player per-spot harvest cooldown, rate limiting, server-side item give via ox_inventory
- πΊοΈ Map Blips β optional per-area minimap blip, toggleable by admin
- π Multilanguage β EN / DE included. Full locale system, add any language in minutes
preview.mp4
Coming soon β drop a PR with your screenshots!
ox_lib β https://github.com/overextended/ox_lib
ox_core β https://github.com/overextended/ox_core
ox_inventory β https://github.com/overextended/ox_inventory
ox_target β https://github.com/overextended/ox_target
oxmysql β https://github.com/overextended/oxmysql
cd resources
git clone https://github.com/RedDragonElite/rde_farming.git# Dependencies first β order matters!
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_inventory
ensure ox_target
# The farming system
ensure rde_farming
Open config.lua and adjust to your server. Sensible defaults work out of the box.
Start your server. No SQL import needed β both tables are created automatically on first boot.
Then in-game, run /farmadmin (or whatever you bind the admin command to), stand where you want the center of a farming area to be, and hit Create Farming Area. That's it. Live, immediately, no restart.
βΉοΈ Required items (e.g.
pickaxe,iron_ore) must exist in yourox_inventoryitems file. rde_farming only checks counts and gives items β it doesn't define them.
config.lua is self-documented. Key sections:
Config.Debug = false
Config.Locale = 'en' -- 'en' or 'de'Config.AllowAcePermissions = true -- also check ACE 'command' and 'admin'
Config.AdminGroups = {
['admin'] = true,
['superadmin'] = true,
['owner'] = true,
['moderator'] = true,
}Config.LoadRadius = 150.0 -- props spawn within this distance (meters)
Config.UnloadRadius = 170.0 -- props despawn beyond this (hysteresis band, no pop-in)
Config.ProximityTick = 1500 -- ms between proximity checks per clientConfig.HarvestCooldown = 3000 -- ms between harvests on the same spot per player
Config.RespawnCheckTick = 5000 -- ms: server polls the respawn queue this often
Config.AnimationDuration = 4000 -- ms: default harvest animation length
Config.PropFadeTick = 100 -- ms: depleted prop fade-out speedConfig.DefaultGatherMin = 1 -- global default minimum items per harvest
Config.DefaultGatherMax = 3 -- global default maximum items per harvest
-- Per-area overrides are set in the admin menu when creating/editing an areaConfig.Colors = {
adminOutline = { r = 255, g = 60, b = 60 }, -- red outline on depleted spots (admin view)
depletedAlpha = 80, -- ghosted alpha on depleted props
areaBlip = { sprite = 280, color = 2, scale = 0.6 },
}
Config.ShowBlips = true
Config.BlipLabel = 'Farming Area'
Config.RandomRotateZ = true -- randomize prop Z rotation for natural varietyOpen with the farmadmin command (ACE command/admin or configured ox_core group).
| Action | Description |
|---|---|
| Create Farming Area | Opens input dialog. Stand at the desired center. Confirm coords. Props are auto-generated within the spawn radius immediately |
| Manage Areas | Lists all existing areas with status badge (β Active / βΈ Inactive) |
| Edit Area | Change any property: name, prop model, tool, animation, reward, limits, respawn time |
| Move Center Here | Stand anywhere and reassign the area center β spots are regenerated |
| Toggle Active | Instantly enable/disable an area for all players. Depleted props removed, active props re-sync |
| Delete Area | Removes area and all its spots from DB. Cascaded by FK. No orphaned rows |
| Field | What it does |
|---|---|
| Name | Display name, shown in admin menus and blip label |
| Prop Model | GTA5 object model spawned at each spot (e.g. prop_rock_3_a, prop_weed_01) |
| Required Tool Item | ox_inventory item name required to harvest. Leave blank = no tool needed |
| Tool Hand Prop | Prop model attached to right hand during harvest animation |
| Reward Item | ox_inventory item given on successful harvest |
| Min / Max Gather | Random amount range per harvest |
| Max Active Spots | How many prop instances spawn in this area |
| Respawn Time (s) | How long after depletion before the spot comes back |
| Spawn Radius (m) | Radius around area center where spots are randomly placed |
| Animation Key | Key from data/animations.lua (e.g. pickaxe_mine, axe_chop) |
| Show Map Blip | Toggle minimap blip for this area |
Animations live in data/animations.lua. Admin picks a key in the area creation menu. Add your own β just add an entry and restart.
| Key | Description | Duration | Tool Prop |
|---|---|---|---|
pickaxe_mine |
Mining / pickaxe swing | 5000ms | prop_tool_pickaxe |
axe_chop |
Wood chopping | 4500ms | prop_cs_hand_axe |
shovel_dig |
Digging / burying | 5500ms | prop_tool_shovel |
hand_pick |
Bare-hand picking | 3000ms | β |
knife_cut |
Cutting / slicing | 3500ms | prop_cs_knife |
crouch_collect |
Crouching, picking up | 4000ms | β |
hand_fish |
Fishing (no rod) | 6000ms | β |
bottle_fill |
Filling a bottle | 4000ms | prop_amb_whiskey_jd01a |
plant_tend |
Plant care / farming | 5000ms | β |
hammer_work |
Hammering / crafting | 4500ms | prop_tool_hammer |
search_ground |
Scavenging / searching | 4000ms | β |
-- data/animations.lua β add inside the Animations table:
['my_custom_anim'] = {
dict = 'amb@world_human_gardener_plant@male@idle_a',
anim = 'idle_a',
duration = 4000,
flag = 1, -- 1 = loop, 0 = play once, 49 = loop upper body
toolProp = 'prop_tool_shovel', -- nil = no prop
boneIndex = 28422, -- 28422 = right hand
propOffset = { x = 0.0, y = 0.0, z = 0.0 },
propRot = { x = 0.0, y = 0.0, z = 0.0 },
},Restart the resource. The key is immediately available in the admin menu dropdown.
Locale files live in locales/. Both en.lua and de.lua are always loaded. The active one is determined by Config.Locale.
Config.Locale = 'de' -- config.luaAdd a new language:
- Copy
locales/en.luaβlocales/fr.lua - Rename the table:
Lang_fr = { ... } - At the bottom:
if Config and Config.Locale == 'fr' then Lang = Lang_fr end - Add
'locales/fr.lua'toshared_scriptsinfxmanifest.lua - Set
Config.Locale = 'fr'
Currently included:
| Code | Language |
|---|---|
en |
π¬π§ English |
de |
π©πͺ Deutsch |
Two tables. Both created automatically on first boot. No SQL import needed.
| Table | Purpose |
|---|---|
rde_farming_areas |
All farming areas β config, center coords, reward, tool, animation, limits |
rde_farming_spots |
All generated spots β position, rotation, depletion state, depleted timestamp |
Spots have a cascading FK on area_id β deleting an area wipes all its spots automatically. No orphaned rows, ever.
rde_farming_areas:
id, name, center_x/y/z, spawn_radius, prop_model,
tool_item, tool_prop, anim_key, reward_item,
gather_min, gather_max, max_spots, respawn_time,
show_blip, is_active, created_by, created_at
rde_farming_spots:
id, area_id (FK β areas), pos_x/y/z, rot_z,
is_depleted, depleted_at-- Harvest a specific spot (validated server-side)
TriggerServerEvent('rde_farming:harvest', spotId, playerPos)
-- Admin: create a new farming area
TriggerServerEvent('rde_farming:createArea', data)
-- Admin: edit an existing area
TriggerServerEvent('rde_farming:editArea', areaId, data)
-- Admin: delete an area (cascades spots)
TriggerServerEvent('rde_farming:deleteArea', areaId)
-- Admin: toggle area active state
TriggerServerEvent('rde_farming:toggleArea', areaId)
-- Admin: move area center to new coords
TriggerServerEvent('rde_farming:setAreaCenter', areaId, newCenter)
-- Admin: regenerate all spots for an area
TriggerServerEvent('rde_farming:regenSpots', areaId)
-- Request full area + spot state (on player init)
TriggerServerEvent('rde_farming:requestAreas')
-- Client signals ready to receive initial sync
TriggerServerEvent('rde_farming:init')-- Area created or updated
AddEventHandler('rde_farming:areaUpdate', function(areaId, data) end)
-- Area deleted
AddEventHandler('rde_farming:areaDelete', function(areaId) end)
-- Spot state changed (depleted / respawned)
AddEventHandler('rde_farming:spotUpdate', function(spotId, data) end)
-- Spot permanently removed
AddEventHandler('rde_farming:spotDelete', function(spotId) end)-- Full area data for any area:
GlobalState['rde_farm_area_' .. areaId]
-- Full spot data for any spot:
GlobalState['rde_farm_spot_' .. spotId]Prefix is configurable: Config.StatebagPrefix = 'rde_farm_'
rde_farming/
βββ fxmanifest.lua β Resource manifest, dependencies
βββ config.lua β All configuration β timing, proximity, visuals, permissions
βββ data/
β βββ animations.lua β Animation library β all harvest animations with props & offsets
βββ locales/
β βββ en.lua β English strings
β βββ de.lua β German strings
βββ client/
β βββ client.lua β Proximity streaming, prop spawning, ox_target, animation, admin menu
βββ server/
βββ server.lua β DB setup, CRUD, harvest validation, respawn scheduler, StateBag sync
- Harvest validated server-side β distance check between player position and spot position
- Per-player per-spot cooldown enforced server-side (
HarvestCooldowns[source][spotId]) - Items given server-side via ox_inventory β client cannot fake a give
- Admin actions gated by ACE + ox_core group check β no client-side bypass possible
- Rate limiting built into the cooldown system β no spam-harvest exploit
- Spot depletion state managed server-side β client cannot mark a spot as available
Enable with Config.Debug = true in config.lua.
Server logs prefix: [RDE Farming SERVER] in green (INFO), yellow (WARN), red (ERROR).
Client logs prefix: [RDE Farming] in F8 console.
| What to check | Where |
|---|---|
| Tables not creating | Server console β [RDE Farming SERVER] Database ready |
| Props not spawning | F8 β proximity enter/exit logs, model load errors |
| Harvest rejected | Server console β distance check output, cooldown state |
| Spots not respawning | Server console β RespawnCheckTick fires every 5000ms |
| Admin menu not opening | Confirm ACE command/admin or correct ox_core group |
| Animation not playing | Check the key matches exactly what's in data/animations.lua |
The client Z-snaps spots to the ground on first render using GetGroundZFor_3dCoord. If you placed the area center at a Z that's far off from the actual ground, spots may take one proximity cycle to settle. This is normal. Regen spots after moving the area center for the cleanest result.
- Confirm the item name in the area config exactly matches the
ox_inventoryitem name (case-sensitive) - Confirm
ox_inventoryis started beforerde_farming - Enable debug β server logs the inventory check result for every harvest attempt
- Enable debug β server logs every respawn queue check
- Check
rde_farming_spots.depleted_atin the DB β must be a valid Unix timestamp (ms) - Confirm
Config.RespawnCheckTickis set (default 5000ms) and the respawn_time of the area is in seconds
Areas are loaded from DB on resource start via rde_farming:requestAreas / rde_farming:init. Check server console for DB errors on startup.
- Confirm the reward item exists in
ox_inventory - Enable debug β server logs the
exports.ox_inventory:AddItemcall and result - Check
gather_minandgather_maxβ if both are 0, no item is given
ox_core β Player auth, group permission check
ox_lib β Context menus, input dialogs, notifications, progress bars, lib.points
ox_inventory β Item requirement check (tool), item give (reward)
ox_target β Harvest interaction zone on each spawned prop
oxmysql β Async DB β areas and spots persist across restarts
StateBags β GlobalState sync for all area/spot state to all clients
PRs are always welcome.
- Fork the repository
- Create a branch:
git checkout -b feature/your-feature - Test on a live server before submitting
- Commit:
git commit -m 'feat: your feature description' - Push:
git push origin feature/your-feature - Open a Pull Request
Guidelines:
- β Keep the RDE header in all files
- β Follow existing code style β ox_core, ox_lib, server-side authority
- β
Run
luac5.4 -pon every.luafile before pushing - β Test on a live server
- β No telemetry, no paywalls, no ESX/QBCore
- β Don't move logic to client-side β harvest authority stays on server
- β Don't hardcode strings β use
Lang['key']and add to all locale files
RDE Black Flag Source License v6.66
###################################################################################
# #
# .:: RED DRAGON ELITE (RDE) - BLACK FLAG SOURCE LICENSE v6.66 ::. #
# #
# PROJECT: RDE_FARMING (DYNAMIC RESOURCE GATHERING FOR FIVEM OX_CORE) #
# ARCHITECT: .:: RDE β§ Shin [β³ αα
α±αα
αΎαα αααα
β½] ::. | https://rd-elite.com #
# ORIGIN: https://github.com/RedDragonElite #
# #
# WARNING: THIS CODE IS PROTECTED BY DIGITAL VOODOO AND PURE HATRED FOR LEAKERS #
# #
# [ THE RULES OF THE GAME ] #
# #
# 1. // THE "FUCK GREED" PROTOCOL (FREE USE) #
# You are free to use, edit, and abuse this code on your server. #
# Learn from it. Break it. Fix it. That is the hacker way. #
# Cost: 0.00β¬. If you paid for this, you got scammed by a rat. #
# #
# 2. // THE TEBEX KILL SWITCH (COMMERCIAL SUICIDE) #
# Listen closely, you parasites: #
# If I find this script on any paid store, Patreon, or "Premium Pack": #
# > I will DMCA your store into oblivion. #
# > I will publicly shame your community on Nostr. Permanently. #
# > I hope every farming spot you ever stand on stays depleted forever #
# and the respawn timer is hardcoded to infinity. #
# SELLING FREE WORK IS THEFT. AND I AM THE JUDGE. #
# #
# 3. // THE CREDIT OATH #
# Keep this header. If you remove my name, you admit you have no skill. #
# You can add "Edited by [YourName]", but never erase the original creator. #
# Don't be a skid. Respect the architecture. #
# #
# 4. // THE CURSE OF THE COPY-PASTE #
# This code implements real proximity streaming, uniform disc spot #
# distribution, StateBag sync, and server-side harvest authority. #
# If you copy-paste without understanding, your spots will spawn in the #
# ocean and your players will harvest nothing forever. #
# Don't come crying to my DMs. RTFM. #
# #
# -------------------------------------------------------------------------- #
# "We build the future on the graves of paid resources." #
# "REJECT MODERN MEDIOCRITY. EMBRACE RDE SUPERIORITY." #
# -------------------------------------------------------------------------- #
###################################################################################
TL;DR:
- β Free forever β use it, edit it, learn from it
- β Keep the header β credit where it's due
- β Don't sell it β commercial use = instant DMCA + permanent Nostr shaming
- β Don't be a skid β copy-paste without reading and your spots spawn in the ocean
| Resource | Description |
|---|---|
| rde_mechanic | Next-Gen Vehicle Mechanic & Tuner β preview, orbit cam, StateBag sync |
| rde_banking | Full banking β prestige tiers, investments, loans, ATM targeting |
| rde_aipd | Ultimate AI Police System β StateBag-synced, Nostr-logged |
| rde_nostr_log | Decentralized FiveM logging via Nostr β replace Discord forever |
| π Website | rd-elite.com |
| π Nostr Terminal | rd-elite.com/Files/NOSTR/Terminal |
| π GitHub | github.com/RedDragonElite |
| π£ Nostr | npub1wr4e24zn6zzjqx8kvnelfvktf0pu6l2gx4gvw06zead2eqyn23sq9tsd94 |
Before opening an issue:
- β Read this README fully
- β
Enable
Config.Debug = trueand include server + F8 logs - β Don't open issues without logs β we can't help without them
Made with π₯ and zero tolerance for paid farming scripts by Red Dragon Elite
The future is ours. We are already inside.
REJECT MODERN MEDIOCRITY. EMBRACE RDE SUPERIORITY.
RDE FOREVER. SYSTEM FAILURE. β‘777β‘