Standard Resource Structure
Every Mythic resource follows this pattern:Not all resources have all folders. Simple resources may only have
fxmanifest.lua and server/ or client/. Complex resources with UIs will have the full structure.The fxmanifest.lua File
The manifest file is required for all FiveM resources. It defines metadata, dependencies, and files to load.Basic Manifest
Mythic Resource Manifest
Mythic resources typically include anti-cheat and organized file loading:Manifest Features
Dependencies
Dependencies
Declare resource dependencies:
Exports
Exports
Define exports other resources can use:
UI Pages
UI Pages
For resources with NUI:
Data Files
Data Files
For resources that add game data:
Directory Breakdown
client/ Directory
Contains all client-side Lua scripts. Common Files:server/ Directory
Contains all server-side Lua scripts. Common Files:shared/ Directory
Contains scripts loaded on both client and server. Use Cases:- Configuration that both sides need
- Shared utility functions
- Constants and enums
- Data structures
config/ Directory
Resource-specific configuration files. Example:ui/ Directory
React-based user interfaces. Structure:File Naming Conventions
Lua Files
Lua Files
Naming Pattern:
- Lowercase with underscores:
item_manager.lua - Or descriptive names:
component.lua,events.lua,main.lua
sh_= Shared (both sides)sv_= Server onlycl_= Client only
React Files
React Files
Components: PascalCaseUtilities: camelCaseReducers: Descriptive with suffix
Config Files
Config Files
Always named
config.lua or descriptive of what they configure:Best Practices
Consistent Structure
Follow the standard structure for all resources. Makes navigation and maintenance easier.
Separate Concerns
Keep client, server, and UI code separate. Don’t mix them in the same file.
Use Wildcards
Use
client/*.lua and server/*.lua in fxmanifest for easier file management.Document Everything
Include README.md explaining what the resource does and how to configure it.
Config Files
Externalize configuration. Never hardcode values that might change.
Modular Code
Break large files into smaller, focused modules. Don’t put everything in main.lua.
Example: Complete Resource
Here’s a simple but complete example resource following Mythic structure:View mythic-example Resource
View mythic-example Resource
Next Steps
Component System
Understand components for resource development
UI Framework
Learn React UI development for Mythic
Architecture
Framework architecture and load order
API Reference
Complete API documentation