Documentation
TebexDiscordYouTubeGitHub
  • Introduction
  • FIVEM FREE RESOURCES
    • BDSC
      • Guides
        • Core Setup
          • Installing BDSC
          • Configuring BDSC
        • Plugin Development
          • What is a Plugin?
          • Plugin Structure
          • Extending Player Objects
      • API
        • Functions
          • Player
          • Server
          • Client
          • Shared
        • Modules
          • Player Manager
          • Buckets
          • Plugins
        • UI Components
    • boii_utils
      • Installation
      • Configuration
      • Modules
      • API
        • Callbacks
        • Characters
        • Commands
        • Cooldowns
        • Debugging
        • Entities
        • Environment
        • Framework Bridge
        • Geometry
        • Items
        • Keys
        • Licences
        • Maths
        • Methods
        • Player
        • Requests
        • Strings
        • Tables
        • Timestamps
        • UI Bridges
        • Vehicles
        • Version
        • XP
        • UI Elements
  • FIVEM PAID RESOURCES
    • Page 2
Powered by GitBook
On this page
  • Folder Layout
  • Loading Behaviour
  • UI Handling
  • Player Extensions
  1. FIVEM FREE RESOURCES
  2. BDSC
  3. Guides
  4. Plugin Development

Plugin Structure

Each plugin in BDSC lives in its own directory under /plugins. There are no strict requirements on what folders a plugin must have. However, player extensions must follow a specific structure.


Folder Layout

plugins/
└── my_plugin/
    ├── player/ # Optional – required only if extending the player object
    │   ├── factory.lua # Required if extending
    │   └── class.lua # Required if extending
    ├── client/ # Optional – client-side logic
    ├── shared/ # Optional – shared constants or data
    ├── server/ # Optional – server-side logic
    ├── ui/ # Optional – required only if plugin uses UI
    └── init.lua # Required – shared plugin entry point (server/client logic)

All folders are technically optional depending on what your plugin does. Only the player/ folder, if present, must include both factory.lua and class.lua exactly.


Loading Behaviour

server/, client/, and shared/ scripts are loaded automatically using:

-- Server Scripts
server_scripts {
    -- Plugin Logic
    "plugins/**/player/class.lua",
    "plugins/**/player/factory.lua",
    "plugins/**/server/*.lua",
    "plugins/**/init.lua",
}

-- Client Scripts
client_scripts {
    "plugins/**/client/*.lua"
}

-- Shared Scripts
shared_scripts {
    "plugins/**/shared/*.lua"
}

Load order is not enforced for context specific folders — use bdsc.get() to load specific modules or enforce dependencies cleanly.

init.lua is treated as a shared plugin entry point and is always loaded. Use it to register hooks, handle setup logic, and separate behaviour with bdsc.is_server. This will become a mandatory entry point for plugin registration as the system evolves.


UI Handling

If your plugin uses a UI:

  • Place UI assets in the /ui folder inside your plugin

  • Do not include your own index.html

  • BDSC uses a shared root index.html to support FiveM’s single-page UI limitation

You must declare your UI files in the plugin’s manifest.json. These are dynamically injected into the main UI shell.

See: Plugin UI


Player Extensions

When extending the player object:

  • You must create a player/ folder

  • You must include:

    • factory.lua: Returns the constructor logic for the extension

    • class.lua: Defines methods that attach to the player instance

This enforced structure allows the core to automatically load and bind player extensions during creation.

See: Extending the Player Object

Last updated 1 day ago