Exports

Fishing Sim V2
Updated 24 days ago · v2.1.8

dirk_fishing exposes a small server-side API so other resources can read and award fishing progression — hook fishing XP into jobs, rewards, events, or your own scripts.

Every export takes a server id (an online player). XP is stored in the player's fishingXp metadata, and levels are derived from XP using the same curve as the in-game guidebook — so anything you set is reflected live (guidebook, catch window, level gates) without a relog.


getXp

Return a player's current fishing XP.

lua
local xp = exports.dirk_fishing:getXp(source)
ArgumentTypePurpose
srcnumberServer id of an online player.

Returns a number (0 if the player has no XP yet or the source isn't loaded).


getLevel

Return a player's current fishing level, derived from their XP via the configured curve (baseXP / modifier / baseLevel / maxLevel under Skill Settings in the Levels section of Script Studio).

lua
local level = exports.dirk_fishing:getLevel(source)
ArgumentTypePurpose
srcnumberServer id of an online player.

Returns a number — the level shown to the player in-game.


addXp

Grant fishing XP to a player. Fires the live UI sync automatically.

lua
exports.dirk_fishing:addXp(source, 250) -- give 250 fishing XP
ArgumentTypePurpose
srcnumberServer id of an online player.
amountnumberXP to add. Non-positive values are ignored.

Returns the player's new XP total (number).


removeXp

Take fishing XP from a player. The total is clamped at 0 (never negative).

lua
exports.dirk_fishing:removeXp(source, 100)
ArgumentTypePurpose
srcnumberServer id of an online player.
amountnumberXP to remove. Non-positive values are ignored.

Returns the player's new XP total (number).


setXp

Overwrite a player's fishing XP outright (clamped to ≥ 0). Useful for resets or migrating XP in from another system.

lua
exports.dirk_fishing:setXp(source, 5000)
ArgumentTypePurpose
srcnumberServer id of an online player.
amountnumberThe XP value to set.

Returns the player's new XP total (number).


Example

lua
-- Reward a delivery job with fishing XP, then check if they levelled up
local before = exports.dirk_fishing:getLevel(source)
exports.dirk_fishing:addXp(source, 300)
local after = exports.dirk_fishing:getLevel(source)

if after > before then
  -- notify the player they hit a new fishing level
end

Tunables for the XP curve (base XP, modifier, base/max level) live under Skill Settings in the Levels section of Script Studio — no Lua edits needed.

Was this page helpful?
This page was last updated on 25 October 2026
DIRKSCRIPTS
All you need for your FiveM server.10% off your first order

Unsubscribe any time.

Copyright © 2026 DirkScripts. Not affiliated with or endorsed by Rockstar North or Take-Two Interactive.