Exports
v2.1.8dirk_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.
| 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 under Skill Settings in the Levels section of Script Studio).
| 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.
| 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).
| 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.
| 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
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.