ngd-foraging

Mushroom foraging with regrowing patches, an in-game zone editor and twelve edible finds for FiveM!

Click to purchase ngd-foraging

Installation Steps

  1. Install ngd-Bridge
    Follow the guide to install ngd-Bridge HERE.
    This script must be started after your core resources (framework, inventory, target, database, etc.).

  2. Install ngd-foraging
    Place ngd-foraging into your resources folder. This script must be started after ngd-Bridge.

  3. Add Items to Your Inventory
    Copy the items listed below into your inventory. All twelve are called Mushroom on purpose: players tell them apart by the icon.

  4. Copy Images
    Move the images from the img folder into your inventory's images folder.

  5. Start Once
    On first start the script creates its two database tables and imports the starter zones from config/zones.lua. After that the zones live in the database and config/zones.lua is only used again on a fresh database.

  6. Configure the Script
    Open config/config.lua and verify the settings will work with your server. Every option is commented.

Items:

Items List (OX) (Click to Expand)
code
["ngd_mushrooms_1"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_1.png" } },
["ngd_mushrooms_2"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_2.png" } },
["ngd_mushrooms_3"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_3.png" } },
["ngd_mushrooms_4"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_4.png" } },
["ngd_mushrooms_5"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_5.png" } },
["ngd_mushrooms_6"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_6.png" } },
["ngd_mushrooms_7"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_7.png" } },
["ngd_mushrooms_8"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_8.png" } },
["ngd_mushrooms_9"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_9.png" } },
["ngd_mushrooms_10"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_10.png" } },
["ngd_mushrooms_11"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_11.png" } },
["ngd_mushrooms_12"] = { label = "Mushroom", weight = 0, stack = true, close = true, description = "", client = { image = "ngd_mushrooms_12.png" } },
Items List (QB Format #1) (Click to Expand)
code
ngd_mushrooms_1 = { name = 'ngd_mushrooms_1', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_1.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_2 = { name = 'ngd_mushrooms_2', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_2.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_3 = { name = 'ngd_mushrooms_3', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_3.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_4 = { name = 'ngd_mushrooms_4', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_4.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_5 = { name = 'ngd_mushrooms_5', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_5.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_6 = { name = 'ngd_mushrooms_6', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_6.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_7 = { name = 'ngd_mushrooms_7', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_7.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_8 = { name = 'ngd_mushrooms_8', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_8.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_9 = { name = 'ngd_mushrooms_9', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_9.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_10 = { name = 'ngd_mushrooms_10', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_10.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_11 = { name = 'ngd_mushrooms_11', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_11.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
ngd_mushrooms_12 = { name = 'ngd_mushrooms_12', label = 'Mushroom', weight = 0, type = 'item', image = 'ngd_mushrooms_12.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
Items List (QB Format #2) (Click to Expand)
code
['ngd_mushrooms_1'] = { ['name'] = 'ngd_mushrooms_1', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_1.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_2'] = { ['name'] = 'ngd_mushrooms_2', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_2.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_3'] = { ['name'] = 'ngd_mushrooms_3', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_3.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_4'] = { ['name'] = 'ngd_mushrooms_4', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_4.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_5'] = { ['name'] = 'ngd_mushrooms_5', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_5.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_6'] = { ['name'] = 'ngd_mushrooms_6', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_6.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_7'] = { ['name'] = 'ngd_mushrooms_7', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_7.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_8'] = { ['name'] = 'ngd_mushrooms_8', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_8.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_9'] = { ['name'] = 'ngd_mushrooms_9', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_9.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_10'] = { ['name'] = 'ngd_mushrooms_10', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_10.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_11'] = { ['name'] = 'ngd_mushrooms_11', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_11.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },
['ngd_mushrooms_12'] = { ['name'] = 'ngd_mushrooms_12', ['label'] = 'Mushroom', ['weight'] = 0, ['type'] = 'item', ['image'] = 'ngd_mushrooms_12.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = '' },

Configuration Notes

  • Zone Editor
    Type /forage in game to open the editor. Create a zone where you stand, drag the radius and count sliders while the circle and preview mushrooms update live, tick the mushrooms that grow there with a weight for each, then Save. Existing zones can be edited, disabled, deleted or teleported to from the list. Press Esc to walk around and look at your zones and F7 to bring the panel back.

  • Who Can Open the Editor
    Anyone with the ace command.forage, or anyone passing your framework's admin check for the groups in Config.Editor.permission. The ace works on every framework. Add one of these to your server.cfg next to your other add_ace lines:

code
# ngd-foraging zone editor
# everyone in the admin group
add_ace group.admin command.forage allow

# or one specific player (use their license from txAdmin)
add_ace identifier.license:1234567890abcdef1234567890abcdef12345678 command.forage allow

# or a dedicated builder group you assign players to
add_ace group.zonebuilder command.forage allow
add_principal identifier.license:1234567890abcdef1234567890abcdef12345678 group.zonebuilder
  • Starter Zones
    config/zones.lua ships five patches around the map. Move or replace them in the editor once and they stay in the database.

  • Regrowth
    Every zone has its own regrow window in minutes. Each picked mushroom comes back one at a time on its own timer at a new spot inside the circle, so patches never look the same twice.

  • Eating
    Every mushroom is a useable item. What each one does is set in config/consumables.lua:

VariantLooks likeEffect
1brown field mushroomFood: hunger up
2fly agaricHigh, small stress relief
3liberty cap clusterHigh, stress relief
4chanterelleFood: hunger and thirst up
5white button clusterFood: hunger up
6violet death capDeadly
7toxic greenDeadly
8blue clusterHigh
9pink glowingHigh, big stress relief
10amber crackedArmor
11cyan tall clusterHigh
12white-hotFull heal, restores hunger, thirst and stress
  • Translations
    Every player-facing string, including notifications, tooltips and the editor panel, lives in config/translate.lua.

  • Debug
    Config.debug = true prints every spawn, despawn, pick, regrow and zone change to the F8 and server consoles.

Do you still need help? Open a ticket in our Discord