lation scripts
scriptsmembershipdocs
see the scripts
Skip to Content
lation ui
lation interact
lation banking
lation shops
lation jobs
lation weed
lation chop shop

classics

money laundering
drug sales
coke processing
meth crafting
metal detecting
scuba diving
PlayersConfigurationDevelopersChangelog
scuba diving

Developers

The scuba diving client and server exports, the functions left open for your own code, and the files that ship open, with signatures, return shapes and Lua examples.

Every export is called on exports.lation_diving. Server exports that act on a player take their server id as source; client exports work on the local player. A player's identifier is the ESX identifier on ESX and the citizenid on Qbox and QBCore.

Client exports

ExportReturns
openMenu()Nothing
isGearEquipped()Whether the player is wearing scuba gear
getPlayerData(type?)The player's record, or one field of it
getLevelData()The XP for each level

openMenu

Client export

exports.lation_diving:openMenu()

Opens the clerk's Scuba Diving menu wherever the player is, after asking CanOpenMenu. It doesn't check setup.job or the clerk's hours, so check what you need before calling it. The shops, the boat deposit and the refund still only go through within 15 meters of start.coords, unless you set it to false.

client.lua
-- With start.coords = false: open the menu from your own ped or zone
exports.lation_diving:openMenu()

isGearEquipped

Client export

local wearing = exports.lation_diving:isGearEquipped()

Returns

boolean
true while the player has scuba gear on
client.lua
if exports.lation_diving:isGearEquipped() then
    return lib.notify({ description = 'Take your scuba gear off first', type = 'error' })
end

getPlayerData (client)

Client export

local data = exports.lation_diving:getPlayerData(type)

Parameters

typestringoptionaldefault nil
One field: identifier, name, level, exp, crates, depth or swam. The whole record when left out.

Returns

table | any
The record (see the server export), or the value of type

Asks the server, so it waits for the answer. The first time a player is looked up, their record is made at level 1.

client.lua
local level = exports.lation_diving:getPlayerData('level')

getLevelData

Shared export

local levels = exports.lation_diving:getLevelData()

Returns

table
The total XP for each level, keyed by level: experience in config/shared.lua

The same export exists on the client and the server.

{ [1] = 0, [2] = 2500, [3] = 10000, [4] = 20000, [5] = 50000 }

Server exports

ExportReturns
getPlayerData(source, type?)A player's record, or one field of it
addPlayerData(source, dataType, amount)Nothing
getLevelData()The XP for each level

getPlayerData

Server export

local data = exports.lation_diving:getPlayerData(source, type)

Parameters

sourcenumber
The player's server id
typestringoptionaldefault nil
One field: identifier, name, level, exp, crates, depth or swam. The whole record when left out.

Returns

table | any | nil
The record (below), or the value of type. nil when the player isn't loaded in your framework.

The first time a player is looked up, a record is made at level 1 and saved. The record is the cached one, so treat it as read-only and change it with addPlayerData.

{
    identifier = 'ABC12345',
    name = 'Jane Doe',  -- character name when the record was made
    level = 2,
    exp = 3120,         -- total XP
    crates = 914,       -- crates picked up
    depth = 239,        -- deepest dive, in feet unless setup.metric is on
    swam = 21245,       -- distance swum underwater in scuba gear, same unit
}
server.lua
local level = exports.lation_diving:getPlayerData(source, 'level')
if level and level >= 3 then
    -- let them buy from your own dive gear shop
end

addPlayerData

Server export

exports.lation_diving:addPlayerData(source, dataType, amount)

Parameters

sourcenumber
The player's server id
dataTypestring
exp, crates, swam or depth
amountnumber
How much to add. Anything 0 or below does nothing, except for depth.
dataTypeWhat happens
expAdds XP and moves the player up past each level they reach, up to the top level. No notice is shown.
crates, swamAdds amount to the total.
depthReplaces the deepest dive with amount.

Nothing is written straight away: the record is saved when the player leaves, when the resource stops and when txAdmin shuts the server down.

server.lua
-- 250 diving XP for finishing your own beach clean-up job
exports.lation_diving:addPlayerData(source, 'exp', 250)

Functions to edit

These ship empty or simple in the open files, for your own code.

CanOpenMenu

function

client/functions.lua
function CanOpenMenu()
    return true
end

Returns

boolean
false keeps the menu shut

Asked every time the menu opens, from the clerk or from openMenu.

client/functions.lua
-- Only on foot
function CanOpenMenu()
    return not cache.vehicle
end

CrateCollected

function

server/functions.lua
function CrateCollected(source, quantity)
end

Parameters

sourcenumber
The player who picked the crate up
quantitynumber
How many crate items they got

Called each time a player picks up a crate, after the crate is in their inventory and before their XP is added.

DivingStopped

function

server/functions.lua
function DivingStopped(source)
end

Parameters

sourcenumber
The group's leader

Called when a group's dive ends: the leader picks Stop Diving or Stop in Continue Diving?, or, with start.continue off, the leader picks up the last crate.

Open files

These ship open, outside the escrow, so you can edit them:

client.lua
server.lua
functions.lua
functions.lua
FileWhat to change there
bridge/client.lua, bridge/server.luaAnother framework or inventory: players, jobs, money, items, usable items and locking the inventory. Each function has an "Add custom … here" branch.
client/functions.luaNotifications, progress bars, menus, dialogs, text prompts and targets (each custom option), the keys and fuel scripts, the clothes swap, the clerk ped and CanOpenMenu.
server/functions.luaWhere the hotspot messages go (SendEmail), logging, opening crates and refilling gear, plus CrateCollected and DivingStopped.

When you add a custom input dialog, note that ShowInput in client/functions.lua tests shared.setup.dialogss for its custom branch; correct it to dialogs so yours runs.

The hotspot messages go through SendEmail(source, message) in server/functions.lua. To use another phone, add a branch for it:

server/functions.lua
elseif Phone == 'my-phone' then
    exports['my-phone']:sendMail(source, 'Diving Expert', 'Scuba Diving', message) 

Add your phone to InitializePhone at the top of the same file too, so it's found on start.

Still stuck? Ask in our Discord: the people who write the scripts answer.

Last updated November 11, 2026

Configuration

Every scuba diving option in the four files under config/, with its key, default value and what it changes, plus the text prompt setting and languages.

Changelog

Every scuba diving release, newest first, with what it added, changed and fixed.

On this page

Client exportsopenMenuisGearEquippedgetPlayerData (client)getLevelDataServer exportsgetPlayerDataaddPlayerDataFunctions to editCanOpenMenuCrateCollectedDivingStoppedOpen files
lation scripts

FiveM scripts for Qbox, QBCore and ESX servers, made to look and work like one product.

store

  • all scripts
  • membership
  • classics

help

  • docs
  • discord
  • email support

legal

  • terms
  • refunds
  • privacy
© 2026 Lation Labslationscripts.com
  • home
  • scripts
  • membership
  • docs