DirkScripts
Exports
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.
lualocal xp = exports.dirk_fishing:getXp(source)
| Argument | Type | Purpose |
|---|---|---|
src | number | Server 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 in the Basic → Skill Settings of the Live Script Configurator).
lualocal level = exports.dirk_fishing:getLevel(source)
| Argument | Type | Purpose |
|---|---|---|
src | number | Server 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.
luaexports.dirk_fishing:addXp(source, 250) -- give 250 fishing XP
| Argument | Type | Purpose |
|---|---|---|
src | number | Server id of an online player. |
amount | number | XP 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).
luaexports.dirk_fishing:removeXp(source, 100)
| Argument | Type | Purpose |
|---|---|---|
src | number | Server id of an online player. |
amount | number | XP 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.
luaexports.dirk_fishing:setXp(source, 5000)
| Argument | Type | Purpose |
|---|---|---|
src | number | Server id of an online player. |
amount | number | The 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 Basic → Skill Settings in the Live Script Configurator — no Lua edits needed.
