Configuration
Complete guide to configuring LuaBeans resources for your FiveM server.
Overview
LuaBeans requires two FiveM resources:
luabeans (Bridge) - Core integration and API communication
luabeans_duty (Duty) - UI/menu layer for duty system
Both resources must be configured and installed for full functionality.
Installation
Step 1: Copy Resources
Copy both resources to your FiveM server:
# From your FiveM server directory
cp -r /path/to/luabeans resources/
cp -r /path/to/luabeans_duty resources/Step 2: Configure Server
Add to server.cfg:
Important:
luabeansmust start beforeluabeans_dutyAPI token must match
LEO_API_TOKENin web panel.envBase URL must be accessible from FiveM server
Step 3: Verify Installation
Start FiveM server
Check console for LuaBeans Bridge startup messages
Join server and test
/dutycommandVerify menu appears and functions
Configuration Files
luabeans/config.lua
Main configuration file for LuaBeans Bridge:
Integration Configuration
rcore_police Integration
When enabled, LuaBeans Bridge will automatically sync duty state with rcore_police.
ESX Integration
luabeans_duty/config.lua
Configuration file for LuaBeans Duty UI:
Convars Reference
Required Convars
LUABEANS_API_BASE
Yes
Web panel base URL
https://hub.example.com
LUABEANS_LEO_API_TOKEN
Yes
API token (matches web panel LEO_API_TOKEN)
abc123...
Example Configuration
Resource Dependencies
Required
Discord Identifiers - All players must have
discord:identifier
Optional
ESX - For job synchronization
rcore_police - For duty state bridge
Custom Menu Systems - Replace default menu if desired
Integration Examples
ESX Integration
If using ESX, enable ESX integration in luabeans/config.lua:
This will:
Set player job to department slug when on duty
Revert to fallback job when off duty
Respect permanent job assignments (if
SwitchJobOnDuty = false)
rcore_police Integration
Automatically bridges duty state with rcore_police:
When enabled, LuaBeans Bridge will trigger:
Troubleshooting
Resources Not Starting
Issue: Resources won't start
Solutions:
Check resource folder names are exactly
luabeansandluabeans_dutyVerify
fxmanifest.luaexists in each resourceCheck console for syntax errors
Verify all dependencies are available
API Connection Failed
Issue: Cannot connect to web panel
Solutions:
Verify
LUABEANS_API_BASEis correctCheck web panel is running and accessible
Verify SSL certificate is valid (if using HTTPS)
Test API endpoint manually:
curl https://hub.example.com/api/leo/user/123/departments -H "Authorization: Bearer TOKEN"Check firewall allows connection from FiveM server
Token Authentication Failed
Issue: API returns 401 Unauthorized
Solutions:
Verify
LUABEANS_LEO_API_TOKENmatches web panelLEO_API_TOKENCheck token is set correctly in
server.cfgVerify token format is correct
Check token hasn't been changed or expired
No Departments Showing
Issue: Player sees no departments
Solutions:
Verify player has
discord:identifierCheck player is assigned to departments in web panel
Verify
DISCORD_GUILD_IDmatches in web panelRefresh player data:
/dutyrefreshcommand or web panel "Refresh roles"Check player has active department memberships
Duty State Not Saving
Issue: Duty state resets on disconnect
Solutions:
This is expected behavior - duty state is session-based
Players must go on duty each time they join
Duty state is not persistent between sessions
This is by design for security and accuracy
Performance Tuning
API Rate Limiting
LuaBeans Bridge caches player data to reduce API calls:
Default cache: 5 minutes (
Config.RefreshIntervalMs = 300000)Adjustable: Increase for less frequent updates
Manual refresh:
/dutyrefreshcommand forces refresh
Network Optimization
Uses connection pooling for HTTP requests
Implements request timeouts (default 5 seconds)
Handles network errors gracefully
Retries failed requests automatically
Security Best Practices
Use HTTPS - Always use HTTPS for API communication
Secure Token - Keep API token secret and secure
Validate Input - Validate Discord IDs and department IDs
Rate Limiting - Respect API rate limits
Monitor Logs - Check logs for suspicious activity
Related Documentation
LuaBeans Bridge - Core integration resource
LuaBeans Duty - Duty system UI
FiveM API Reference - Complete API documentation
LEO Duty System - Web panel configuration
Last updated
