QBCore Frameworkqbcore.netCommunity docs
On this page

Updated 2026-10-11 · 3 min read

qb-diving: diving gear, coral collection and sale

qb-diving lets players use diving equipment to collect coral and sell it through configured locations. This page is pinned to commit 6447b72. The resource does not implement a generic scuba certification, procedurally generated treasure registry or SQL log system.

Install and configure

The manifest loads QBCore locale helpers, config.lua, a server script, the client script and two PolyZone client modules. Ensure qb-core, PolyZone and the inventory/item dependencies actually used by your deployment start first.

The source registers usable items diving_gear and diving_fill. Ensure both names exist in the installed item list, then test with an actual client.

Actual configuration

The config.lua defines:

KeyRole
Config.UseTargetToggles target interactions using the server convar
Config.CopsChanceChance of triggering a police notification
Config.OxygenLevelDiving oxygen behavior
Config.RemoveDivingGearWhether the diving gear item is consumed
Config.CoralLocationsCollectible coral positions/availability
Config.CoralTypesCoral item types
Config.BonusTiersReward calculations for quantities
Config.SellLocationsCoral buyer locations

Change coral entries in the existing config and verify spawn coordinates and the item table. Do not invent Config.TreasureRespawnTime, Config.MaxDivingDepth, Config.RentalLocations or Config.CertificationLevels for this version.

Events, callbacks and exports

The client code registers qb-diving:client:UseGear, SetOxygenLevel, NewLocations, UpdateCoral and CallCops.

The server code registers qb-diving:server:CallCops, SellCorals, TakeCoral and removeItemAfterFill; it also creates qb-diving:server:GetDivingConfig as a QBCore callback.

This resource registers no standalone StartDiving, CreateDivingSpot or GetOxygenLevel exports in the reviewed revision. Event names are internal to the source; item payouts must validate inventory, coral availability and the player's allowed interaction location server-side.

Inventory and sale flow

The official server removes sold coral with qb-inventory:RemoveItem and awards coral using qb-inventory:AddItem. That means a different inventory fork may require an integration adapter. Use qb-inventory to confirm method signatures, then validate rewards and sale prices against server-owned data.

Troubleshooting

SymptomFirst check
Diving equipment unusableShared item names, usable-item handler and inventory
Coral never appearsConfig.CoralLocations and qb-diving:client:NewLocations
Oxygen never resetsdiving_fill item, SetOxygenLevel and client console
Sales failCorrect sale location, coral item names and inventory API
Police notifications missingCopsChance and registered alert event
No such export StartDivingNo such export in current upstream

Update checklist

  1. Pin qb-diving, qb-core, qb-inventory and interaction dependencies.
  2. Test underwater gear, coral pickup, sale, inventory full and reconnect.
  3. Verify server-side limits against repeated or forged coral collection/sale requests.
  4. Reconcile local item/config modifications before replacing source.

Sources

Repository · Config · Client · Server

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website