ngd-foraging
Mushroom foraging with regrowing patches, an in-game zone editor and twelve edible finds for FiveM!
Click to purchase ngd-foragingInstallation Steps
-
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.). -
Install ngd-foraging
Placengd-foraginginto your resources folder. This script must be started afterngd-Bridge. -
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. -
Copy Images
Move the images from theimgfolder into your inventory's images folder. -
Start Once
On first start the script creates its two database tables and imports the starter zones fromconfig/zones.lua. After that the zones live in the database andconfig/zones.luais only used again on a fresh database. -
Configure the Script
Openconfig/config.luaand verify the settings will work with your server. Every option is commented.
Items:
Items List (OX) (Click to Expand)
["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)
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)
['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/foragein 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 acecommand.forage, or anyone passing your framework's admin check for the groups inConfig.Editor.permission. The ace works on every framework. Add one of these to yourserver.cfgnext to your otheradd_acelines:
# 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.luaships 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 inconfig/consumables.lua:
| Variant | Looks like | Effect |
|---|---|---|
| 1 | brown field mushroom | Food: hunger up |
| 2 | fly agaric | High, small stress relief |
| 3 | liberty cap cluster | High, stress relief |
| 4 | chanterelle | Food: hunger and thirst up |
| 5 | white button cluster | Food: hunger up |
| 6 | violet death cap | Deadly |
| 7 | toxic green | Deadly |
| 8 | blue cluster | High |
| 9 | pink glowing | High, big stress relief |
| 10 | amber cracked | Armor |
| 11 | cyan tall cluster | High |
| 12 | white-hot | Full heal, restores hunger, thirst and stress |
-
Translations
Every player-facing string, including notifications, tooltips and the editor panel, lives inconfig/translate.lua. -
Debug
Config.debug = trueprints 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