Skip to content

Build a Fishing Module

A complete walkthrough of building a fishing minigame from scratch. Covers module scaffolding, services, inventory integration, NUI feedback, and testing.

INFO

This is the same module introduced in Your First Module, expanded with more depth.

What You'll Build

  • /fish command that players use near fishing spots
  • 60% catch chance, with weighted fish types
  • Fish added to player inventory via IInventory
  • Notification on catch/miss via INotifications
  • Fishing log stored in the database
  • Unit tests for the catch logic

View the full source code on GitHub →

Steps

  1. Scaffold the module
  2. Edit manifest.lua
  3. Add config
  4. Create the migration
  5. Write the service
  6. Add client feedback
  7. Write tests

Extensions

After completing this tutorial, try:

  • Add a fishing rod item requirement
  • Add a cast animation using TaskPlayAnim
  • Show a progress bar during the cast wait
  • Add a leaderboard command
  • Sell fish to an NPC using IEconomy

Released under the MIT License.