๐ŸBeekeeping Script

1) Overview

Risk Beekeeping is a fully featured beekeeping job script for FiveM servers featuring:

  • ๐Ÿ Placeable beehives with real collection timers

  • ๐Ÿ—บ๏ธ Forest scan zones โ€“ players must find the right location

  • ๐Ÿฏ Full honey processing chain (harvest โ†’ clean โ†’ mix โ†’ sell)

  • ๐Ÿงฅ Beekeeper suit system with sting damage

  • ๐Ÿช Built-in shop, seller NPC and processing stations

  • ๐Ÿ—‘๏ธ Auto-delete system for inactive hives with player notifications

  • ๐Ÿ”’ Fully exploit-safe โ€“ all logic runs server-side

  • ๐Ÿ“ฆ Supports ESX, QBCore and QBox (auto-detected)

  • ๐Ÿ—„๏ธ SQL-based data storage via oxmysql


2) File Structure

You have access to these configuration files:

risk-beekeeping/
โ”œโ”€โ”€ beekeeping.sql               โ† Run this once in your database
โ””โ”€โ”€ config/
    โ”œโ”€โ”€ config_general.lua       โ† Max hives, forest zones, scanner item
    โ”œโ”€โ”€ config_collector.lua     โ† Hive placement, bee timer, auto-delete
    โ”œโ”€โ”€ config_market.lua        โ† Shop location, items, prices, NPC
    โ”œโ”€โ”€ config_seller.lua        โ† Seller NPC, sellable items, prices
    โ”œโ”€โ”€ config_cleaner.lua       โ† Honey cleaner location and rewards
    โ”œโ”€โ”€ config_mixer.lua         โ† Honey mixer location and rewards
    โ”œโ”€โ”€ config_clothing.lua      โ† Beekeeper suit, sting damage
    โ”œโ”€โ”€ config_zones.lua         โ† Forest scan zones
    โ””โ”€โ”€ config_notifications.lua โ† All notification texts

3) Database Setup

Run the file beekeeping.sql once in your database before starting the script.

Step 1: Run the SQL file

  1. Open HeidiSQL, phpMyAdmin or any SQL tool

  2. Select your FiveM database

  3. Open beekeeping.sql from the script folder

  4. Execute the file

This creates two tables:

Table
Purpose

beekeeping_hives

Stores all placed hives with position, owner, and timer

beekeeping_pending_notify

Stores deletion notifications for offline players

โš ๏ธ IMPORTANT: If you update the script and the table already exists, run only the ALTER TABLE line shown in the SQL file โ€“ do not run the full file again.


4) Items Setup

For ESX / QBCore / QBox

Inside the [items]/ folder you will find:

  • items.lua โ€“ item definitions to add to your framework

  • [items]/sql/ โ€“ ready-to-use SQL files (de, en, es, fr, ru, zh)

Run the SQL file for your language or manually add the items using items.lua.

Required Items

Item Name
Description

hive

Beehive โ€“ used to place in the world

bees

Bees โ€“ placed into the hive to start collecting

beehiveframe

Frame โ€“ consumed when placing (5x required by default)

forestscanner

Scanner โ€“ reveals allowed placement zones on the map

beekeeper_suit

Protective suit โ€“ protects against bee stings

dirtyhoney

Raw honeycomb โ€“ reward when harvesting

cleanhoney

Clean honey โ€“ output of the Cleaner station

emptyhoneyjar

Empty jar โ€“ required for the Mixer

honeyjar

Honey jar โ€“ finished product ready to sell

scraper

Hive tool โ€“ required to use the Cleaner


5) server.cfg Setup

Add the following to your server.cfg:

โš ๏ธ IMPORTANT: oxmysql and ox_lib must start before risk-beekeeping.

The framework (ESX, QBCore or QBox) is detected automatically at runtime โ€“ nothing needs to be set manually.


6) Configuration

config_general.lua โ€” General Settings

Setting
Description

Debug

Enable debug prints in the server console. Always false in production.

IdentifierType

Player identifier used for ownership. "license" or "steam".

MaxHivesPerPlayer

Maximum number of active hives per player at the same time.

ForestScannerItem

Item name of the forest scanner. Only change if you renamed the item.


config_zones.lua โ€” Forest Scan Zones

Zones define where players are allowed to place beehives. Players must be inside a zone to place a hive.

Parameters:

Parameter
Description

name

Zone name displayed to the player

center

Center coordinates of the zone

radius

Zone radius in meters

color

Blip color when the zone is revealed by the scanner

alpha

Blip transparency (0โ€“255)

maxHives

Maximum number of hives allowed in this zone at the same time

How to find coordinates:

  • Use /coords in-game (if your server has this command)

  • Or use the F8 console and type getpos in supported scripts

Add a new zone:

Disable zone limit (unlimited hives per zone):


config_collector.lua โ€” Beehive & Timing โญ

This is the most important config file. Start here.

Setting
Description

BeesWaitTime

How long bees collect honey, in seconds. Example: 3600 = 1 hour

DeleteAfterDays

Days until inactive hives are auto-deleted. Set 0 to disable

RewardItem

Item the player receives when harvesting the hive

RewardQuantity

How many of the reward item the player receives

RequiredFramesItem

Item consumed when placing the hive

RequiredFramesCount

How many frames are needed to place a hive

BeeItem

Item used to place bees into the hive

Timer examples:

Hive blip settings:

Optional placement items (e.g. require a hammer and wood to place):

๐Ÿ’ก TIP: Set enabled = false to skip this requirement completely.


config_market.lua โ€” Shop

The market is where players buy all beekeeping supplies.

Setting
Description

Location

Coordinates of the shop marker

ShowDistance

Distance from which the marker becomes visible

MarkerRadius

Distance at which the player can interact

OpenKey

Key to open the shop (default: 38 = E)

NPC.enable

Show an NPC at the shop location

NPC.model

NPC model name

NPC.coords

NPC position and heading (vector4)

Blip.enable

Show a map blip for the shop

Shop items โ€” add, remove or change prices:

Parameter
Description

name

Display name shown in the shop UI

item

Internal item name (must match your items)

price

Price shown in the UI (use "$30" format)

amount

How many items the player receives per purchase

description

Short description shown in the shop

image

Image filename from the html/images/ folder


config_seller.lua โ€” Seller NPC

The seller is where players sell processed honey products.

Setting
Description

Location

Coordinates of the seller marker

SellAmount

How many items are sold per click

ItemsToSell

List of sellable items with labels and prices

PaymentMethods

Payment options shown to the player (Cash / Bank)

NPC.enable

Show an NPC at the seller location

Change sell prices:

Change items sold per click:


config_cleaner.lua โ€” Honey Cleaner

The cleaner converts raw honeycomb into clean honey.

Setting
Description

Location

Coordinates of the cleaner station

RequiredHoneyItem

Input item (raw honeycomb)

RequiredHoneyCount

How many input items are consumed per cycle

RequiredToolItem

Tool required to use the cleaner (not consumed)

RewardItem

Output item (clean honey)

RewardQuantity

How many output items are produced

Processing ratio example (10 dirty โ†’ 5 clean):


config_mixer.lua โ€” Honey Mixer

The mixer combines clean honey and an empty jar into a sellable honey jar.

Setting
Description

Location

Coordinates of the mixer station

RequiredHoneyItem

Input item (clean honey)

RequiredHoneyCount

How many input items are consumed per mix

RequiredEmptyJarItem

Empty jar consumed per mix

RewardItem

Output item (honey jar)

RewardCount

How many output items are produced


config_clothing.lua โ€” Beekeeper Suit

Controls the protective suit system and bee sting mechanics.

Setting
Description

ClothingEnabled

Enable or disable the entire suit system

SingleSuitItem

Item name of the beekeeper suit

MatchTextures

true = suit texture must also match; false = only check the drawable

HiveDangerDistance

Distance in meters at which bees start stinging

DamageInterval

Time between stings in milliseconds (8000 = every 8 seconds)

DamageAmount

Health removed per sting

MinimumHealth

Health will never go below this value

Disable sting damage completely:

Make bees more aggressive:


config_notifications.lua โ€” Notification Texts

All messages shown to players can be edited here.

๐Ÿ’ก TIP: Keep placeholders like {minutes}, {count}, {days}, {item}, {max} in place โ€“ they are automatically replaced with real values.

Important placeholders:

Placeholder
Used in
Replaced with

{minutes}

beesNotReady, placeBeesSuccess

Remaining minutes

{count}

collectorMissingFrames, zoneHiveCapReached

Item count / hive count

{max}

maxHiveReached, zoneHiveCapReached

Max allowed amount

{item}

missingPlaceItem, cleanerMissingHoney

Item name

{days}

hiveDeletedInactive

Days from DeleteAfterDays

Translate to German (example):


7) Player Gameplay Flow

This is the full process a player follows from start to finish:


8) Auto-Delete System

Hives that are left inactive are automatically deleted after the number of days set in DeleteAfterDays.

How the timer works:

Situation
Timer starts

Hive placed, no bees added

From the moment the hive was placed

Bees placed (even after 2 days)

Timer resets to the moment bees were placed

Hive ready but not harvested

From the moment the bees finished collecting

Disable auto-delete:

Player notifications:

  • Online โ€” Player is notified immediately when their hive is deleted

  • Offline โ€” Notification is saved and shown the next time the player logs in

If a player had multiple hives deleted, they receive one combined message:

๐Ÿ’ก TIP: Customize the message text in config_notifications.lua โ†’ hiveDeletedInactive.


9) Troubleshooting

โŒ Hive cannot be placed

Possible causes:

  • Player is not inside a ForestScanZone

  • Zone has reached maxHives limit

  • Player already has MaxHivesPerPlayer active hives

  • Player is missing required items (frames, etc.)

Solution:

  • Check zone coordinates in config_zones.lua

  • Increase maxHives or MaxHivesPerPlayer if needed

  • Verify all required items are in the player's inventory


โŒ Hive timer shows wrong time

Possible causes:

  • This was a known bug caused by client/server time mismatch

Solution:

  • This bug is fixed in the current version

  • Restart the server after updating


โŒ Items not recognized

Possible causes:

  • Items not added to the database or items.lua

  • Wrong item name in config

Solution:

  • Run the SQL file from [items]/sql/ for your language

  • Make sure item names in config match exactly (case-sensitive)


โŒ SQL error on server start

Possible causes:

  • beekeeping.sql has not been run

  • oxmysql starts after risk-beekeeping

Solution:

  • Run beekeeping.sql in your database

  • Make sure ensure oxmysql comes before ensure risk-beekeeping in server.cfg


โŒ NPC not visible

Possible causes:

  • NPC is disabled in config

  • Wrong coordinates

Solution:

  • Check NPC.enable = true in config_market.lua / config_seller.lua

  • Verify NPC coordinates are correct


โŒ Bees not stinging without suit

Possible causes:

  • ClothingEnabled is set to false

  • Player is too far from the hive

Solution:

  • Set ClothingEnabled = true in config_clothing.lua

  • Check HiveDangerDistance โ€“ increase if needed


โŒ Hives not being auto-deleted

Possible causes:

  • DeleteAfterDays is set to 0

  • Hives do not meet the deletion conditions yet

Solution:

  • Set DeleteAfterDays to a value greater than 0

  • The check runs every hour and on server restart


10) Best Practices

โœ… Set BeesWaitTime to match your server economy โ€” Too short = too easy, too long = players lose interest โœ… Configure all 4 locations โ€” Market, Seller, Cleaner and Mixer should all be at different spots โœ… Use the Forest Scanner โ€” Make sure at least 1-2 zones are within the map boundaries โœ… Set maxHives per zone โ€” Prevents one player from monopolizing a zone โœ… Enable DeleteAfterDays โ€” Keeps the database clean and prevents ghost hives โœ… Keep item names lowercase โ€” Item names are case-sensitive โœ… Test all stations โ€” Buy items, place hive, harvest, clean, mix, sell before going live โœ… Backup config files โ€” Save copies before making changes


11) Quick Start Checklist

  • [ ] Run beekeeping.sql in the database

  • [ ] Add items via [items]/sql/ or items.lua

  • [ ] Add ensure risk-beekeeping to server.cfg

  • [ ] Set MaxHivesPerPlayer in config_general.lua

  • [ ] Set zone coordinates in config_zones.lua

  • [ ] Set BeesWaitTime in config_collector.lua

  • [ ] Set DeleteAfterDays in config_collector.lua

  • [ ] Set Market location in config_market.lua

  • [ ] Set Seller location and prices in config_seller.lua

  • [ ] Set Cleaner location in config_cleaner.lua

  • [ ] Set Mixer location in config_mixer.lua

  • [ ] Adjust sell prices in config_seller.lua

  • [ ] Start the server and test all stations in-game

Last updated