What hooks are
atlasFishing is uploaded to keymaster with asset escrow — the gameplay, client, and server logic is encrypted and not editable. Two files are deliberately left open so you can extend the resource:escrow_ignore in fxmanifest.lua, and each is loaded before the rest of its side:
fxmanifest.lua
Fishing.Hooks table always exists by the time the protected code calls into it. You edit the function bodies in these two files; you never edit anything else. An empty body is a no-op — the script checks each hook exists before calling it, so deleting a hook you don’t use is also fine.
These hooks supersede and expand the short “Editable hooks” section on the Configuration page. The hook names and arguments here are the source of truth.
Client vs server hooks
Hooks are split by side, and each side can only do what that side can do.- Client — editable/client.lua
- Server — editable/server.lua
Runs on the player’s machine. Use these for presentation: toggling a HUD, playing a sound, a screen effect, a local notification. They have no authority over the catch or the player’s inventory.
OnMinigameOpen(id)OnMinigameClose(id, result)OnCastStart()OnCatch(data)OnCancel(reason)
Death is already handled
When a player dies mid-attempt, the bridge’s built-inBridge.OnDeath fires and atlasFishing calls Fishing.Cancel('death'), which unwinds the cast / bite-wait / minigame cleanly (toggle with Config.death.enabled). You do not need a hook for this. If you want to react to that cancel — for example to make sure your HUD comes back — use the client OnCancel(reason) hook, where reason will be 'death'.
Hook reference
Client hooks — editable/client.lua
Fires the instant a minigame’s NUI is about to open (right after NUI focus is granted).Return value is ignored.
Which minigame:
'tension', 'whirlpool', 'castmeter', or 'rhythm'.Fires after the minigame resolves and NUI focus has been released.Return value is ignored.
The minigame that just closed (same set as above).
The outcome reported by the minigame:
'success', 'fail', 'timeout', or 'cancel'. (A death/cancel resolves the minigame through its 'fail' path.)Fires once per attempt, right after the rod is equipped and just before the casting progress bar. No arguments. Return value is ignored.
Fires on the catching player’s client just before the catch presentation (the fish spawning on the ground, the flop, the pickup, the hold-up). This is presentation only — the item has not been granted yet; the server grants it on claim. For reward logic, use the server Return value is ignored.
OnFishCaught hook instead.The presentation payload:
| Field | Type | Meaning |
|---|---|---|
label | string | Display name, e.g. "Golden Koi". |
item | string | Inventory item key, e.g. "fish_koi". |
tier | string | junk · common · uncommon · rare · epic · legendary. |
prop | string | Prop model used in the presentation. |
junk | boolean | true for junk pulls (shells/critters — no item granted). |
Fires when an in-progress attempt is canceled via Return value is ignored.
Fishing.Cancel.Currently
'death'. Treat any other value as a generic cancel — the set may grow.Server hooks — editable/server.lua
Fires server-side after a real fish has been added to the player’s inventory (in the Return value is ignored.
fishing:claim callback). Does not fire for junk pulls. This is the correct, authoritative place to award extra rewards or log catches.The player’s server ID.
The matching
Config.fish entry — key, label, tier, price, prop, and any custom fields you added to that entry.Worked examples
All examples are copy-paste-ready into the matchingeditable/ file. They use the global Bridge (provided by atlasBridge), which is loaded before atlasFishing, so it is always available inside your hooks.
Hide a custom HUD during a minigame
The minigame takes NUI focus and fills the screen, so a busy HUD underneath looks cluttered. Hide it on open and restore it on close. The pattern works withSendNUIMessage to your own HUD resource, or with an export your HUD exposes.
SendNUIMessage targets atlasFishing’s own NUI page, so it only works here if your HUD lives in the same resource. To talk to a separate HUD resource, use that resource’s export (or exports['my-hud']:...) as in the first tab.Award a custom item or bonus money on a catch
Use the server hookOnFishCaught — it runs after the fish is already in the player’s inventory, with full server authority. Here we drop occasional bonus cash and a guaranteed extra item on legendary catches.
editable/server.lua
Notify on rare catches
A simple flourish: announce only the good pulls. Use the clientOnCatch hook so the message lands the moment the catch is presented. data.tier tells you the rarity; data.junk lets you skip junk.
editable/client.lua
Server-side notifications take the player id first:
Bridge.Notify(src, { ... }). Client-side they take just the payload: Bridge.Notify({ ... }). Mind which side your hook is on.Reward sellers (server OnSell)
OnSell is handy for loyalty bonuses, taxes, or logging revenue. Here, a flat 5% bonus on top of any sale of 10+ fish:
editable/server.lua
Gating and canceling — what hooks cannot do
You may want to require something before a player can fish — an item, a job, a zone — and block the attempt otherwise. Hooks cannot do this. They are observers:OnCastStart fires after the rod is already equipped and the cast has begun, and its return value is ignored, so there is no hook that can stop a cast, reject a catch, or veto a sale.
Use the supported, server-authoritative levers instead:
Require an item — use bait as the gate
Fishing already requires the rod item and consumes a bait per attempt (rolled and removed server-side in
fishing:begin). To require a permit or licence, make it a bait the player must own, or sell the rod only to players who qualify. This is the intended progression lever — see Baits and the supplies shop.Restrict zones — use multipliers, not blocks
Config.zones boost or reduce odds per tier; by design they never gate fishing — players can fish anywhere. Set a tier’s multiplier to 0.0 to make it impossible in open water but possible only inside a zone, which is the closest supported “you must be here for X” behavior. See Hotspot zones.Gate by job/permission — do it where you control the rod
The cleanest job/permission gate is to control who can obtain the rod (e.g. only sell it to a
fisherman job), since possessing the rod is what unlocks fishing. The bridge exposes Bridge.GetJob(src) and Bridge.IsAdmin(src) server-side if you build that check into your own shop or item-granting flow.Testing your hooks
Enable debug logging
Turn on the bridge’s debug output so you can see hook-adjacent activity in the server/client consoles:(atlasFishing also has its own
server.cfg
Config.debug flag in config.lua for extra fishing-specific output.)Reload after every edit
The A
editable/ files are plain scripts — changes only take effect on a resource restart:refresh is not needed for edits to existing files, but restart the resource so the new hook bodies load.Drive the hooks quickly
Use the built-in admin command to hand yourself fish and bait without grinding:Then fish (or sell) to fire
OnCatch / OnFishCaught / OnSell, and watch your print output or HUD react.