> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shdevelopment.org/llms.txt
> Use this file to discover all available pages before exploring further.

# sh-fishing: Full Fishing Script for FiveM Servers

> sh-fishing adds zone-restricted fishing with bait shops, a button-mash catch mechanic, and NPC fish selling. Supports standalone and NAT2K15.

sh-fishing brings a complete fishing minigame to your FiveM server. Players purchase bait from a shop NPC, travel to one of the designated PolyZone fishing areas, cast their line with `/fish`, wait for a bite, then mash `[E]` to reel in their catch — and finally sell their haul to a buyer NPC for cash. The script runs in either a fully standalone mode (no external money system required) or integrates with NAT2K15 for persistent economy support.

## Dependencies

<Note>
  You must install **PolyZone** before starting sh-fishing. Without it, the zone-restricted casting system will not function and the resource will throw errors on startup.
</Note>

| Dependency                                      | Required   | Notes                                         |
| ----------------------------------------------- | ---------- | --------------------------------------------- |
| [PolyZone](https://github.com/mkafrin/PolyZone) | ✅ Yes      | Defines all fishing zone boundaries           |
| NAT2K15                                         | ❌ Optional | Required only when `Config.Framework = 'nat'` |
| okokNotify                                      | ❌ Optional | Required only when `Config.Notify = 'okok'`   |

## Gameplay Flow

<Steps>
  <Step title="Buy bait">
    Approach a bait shop NPC and purchase bait. Each purchase gives you `Config.PurchaseBaitAmount` units at `Config.BaitPrice` per transaction.
  </Step>

  <Step title="Travel to a fishing zone">
    Head to one of the six PolyZone fishing areas. Zone blips appear on the map when `Config.LocationBlips = true`.
  </Step>

  <Step title="Cast your line">
    Run `/fish` while standing inside a valid zone with bait in your inventory. Your character will play a casting animation and the line will go in.
  </Step>

  <Step title="Wait for a bite">
    The script waits a random number of seconds between `Config.MinBaitTookTime` and `Config.MaxBaitTookTime` before a fish bites. Stay patient.
  </Step>

  <Step title="Reel in with [E]">
    Once a fish bites, mash `[E]` as fast as you can. You have `Config.TimetoMash` seconds to register between `Config.MashMin` and `Config.MashMax` key presses — miss the window and the fish escapes.
  </Step>

  <Step title="Sell your catch">
    Take your fish to a buyer NPC sell point. Each fish earns `Config.FishPrice` in cash.
  </Step>
</Steps>

## Commands

| Command          | Description                                                        |
| ---------------- | ------------------------------------------------------------------ |
| `/fish`          | Start fishing — must be inside a valid PolyZone area and have bait |
| `/fishinventory` | Display your current bait count and fish count                     |
| `/propstuck`     | Emergency cleanup to remove any props stuck to your character      |

## Configuration

Open `config.lua` to customise sh-fishing for your server. The most important settings are covered below.

```lua config.lua theme={null}
Config.Framework = 'nat'         -- 'standalone' or 'nat' (NAT2K15)
Config.Notify    = 'standalone'  -- 'standalone' (GTA native) or 'okok' (okokNotify)

Config.BaitPrice           = 25  -- Price per bait purchase
Config.PurchaseBaitAmount  = 25  -- Bait units received per purchase
Config.FishPrice           = 60  -- Cash paid per fish sold

Config.MinBaitTookTime = 4   -- Minimum seconds before a fish bites
Config.MaxBaitTookTime = 8   -- Maximum seconds before a fish bites

Config.TimetoMash = 10  -- Seconds the player has to mash [E]
Config.MashMin    = 10  -- Minimum presses required to land the fish
Config.MashMax    = 30  -- Maximum presses required to land the fish

Config.LocationBlips = true  -- Show map blips for all fishing zones

Config.BaitShopLocations = {
    vector3(-2188.22, -400.52, 12.25),
}
Config.SellShopLocations = {
    vector3(-2205.15, -373.32, 12.25),
}
```

<Tip>
  Increase `Config.MashMin` and `Config.MashMax` together to make fishing harder, or lower `Config.TimetoMash` to create a tighter reeling window.
</Tip>

## Fishing Zones

sh-fishing ships with six PolyZone areas out of the box:

| Zone             | Location                                        |
| ---------------- | ----------------------------------------------- |
| Vespucci Ocean   | Coastal waters along the western shoreline      |
| Sandy Bridge 1   | River section near Sandy Shores (north section) |
| Sandy Bridge 2   | River section near Sandy Shores (south section) |
| Sandy Lake       | Inland lake in the Sandy Shores region          |
| Vespucci Ocean 2 | Extended coastal waters south of Vespucci       |
| Paleto Ocean     | Northern bay waters near Paleto Bay             |

All zone polygons are defined in `locations.lua`. This file is **escrow-ignored**, meaning you can edit it freely without affecting the encrypted portion of the resource.

### Adding Custom Zones

To add a new fishing area, open `locations.lua` and append a new PolyZone polygon entry following the existing format. Each zone is a table of `vector2` coordinates that form a closed polygon around the water you want to designate.

```lua locations.lua theme={null}
-- Example: add a custom fishing zone
Config.FishingZones = {
    -- Existing zones ...
    [7] = {
        points = {
            vector2(100.0, 200.0),
            vector2(150.0, 200.0),
            vector2(150.0, 250.0),
            vector2(100.0, 250.0),
        },
        minZ = 0.0,
        maxZ = 100.0,
        box = false
    },
}
```

<Warning>
  Do **not** rename the resource folder. sh-fishing checks its own resource name on startup and will immediately stop itself if the name does not match `sh-fishing`. Keep the folder name exactly as shipped.
</Warning>
