Skip to content

Discord Weapon Permissions

A guide to install Discord wPerms! for FiveM

Drag, drop and configure! Supported by our free Discord API. This script allows you to restrict weapons to Discord roles. The Discord role will be required to wield a specified weapon.

  • Discord Role Integration - Restrict weapon access by Discord roles
  • Weapon Permission System - Require Discord roles to wield specified weapons
  • Free Discord API - Supported by our included Discord API resource
  • Drag & Drop Setup - Simple configuration and deployment
  • Role-Based Access - Require specific Discord roles for weapon access
  • Multiple Weapon Categories - Organize weapons by role requirements
  • Standalone - Works independently without framework dependencies
  • Universal Compatibility - Works with any FiveM server

Download this resource via CFX Portal Assets after purchasing. It can take a few minutes for the resource to appear in the CFX Portal after purchase.

  1. Extract the ZIP package to your local machine
  2. Transfer files using binary FTP mode to your server’s resources folder
  3. Ensure the folder is named night_discord_wperms (do not rename)

Add the resource to your server.cfg:

ensure night_discord_wperms
  1. Open /config/config.lua in your preferred editor
  2. Configure Discord roles and weapon permissions
  3. Test the resource functionality
  • Standalone: Works independently without any framework
  • Any FiveM Server: Universal compatibility
  • OneSync Legacy: Fully tested and compatible
  • OneSync Infinity: Fully tested and compatible
  • Included: Discord API resource (included in this package)
File Purpose
night_discord_wperms/config/config.lua Main configuration and Discord settings
night_discord_wperms/client/c_functions.lua Client-side functions
night_discord_wperms/server/s_functions.lua Server-side functions
  1. Open VS Code and navigate to the config files
  2. Read thoroughly - each line has explanatory comments in green text
  3. Configure Discord roles - set up role-based weapon permissions
  4. Configure weapon lists - assign weapons to specific Discord roles
  5. Test frequently - use F8 console for error checking
  • Discord Role Verification - Check player’s Discord roles for weapon access
  • Weapon Allowlist - Configure which weapons each role can wield
  • Real-Time Validation - Verify permissions when players equip weapons
  • Access Control - Restrict weapon access based on Discord roles
  • Role-Based Lists - Set up lists of weapons per Discord role(s)
  • Multiple Roles - Support for multiple Discord roles per weapon
  • Weapon Categories - Organize weapons by role requirements
  • Permission Hierarchy - Manage different access levels
  • Discord Integration - Configure Discord API settings and webhooks
  • Role Assignment - Assign Discord roles to weapon access
  • Weapon Lists - Create lists of weapons for each role
  • Access Control - Set up permission requirements and restrictions
  • Debug Settings - Enable debugging for troubleshooting
  • Free Discord API - Supported by our included Discord API resource
  • Role Verification - Real-time Discord role checking
  • Webhook Integration - Discord notifications and logging
  • API Management - Handle Discord API connections and authentication
  • Standalone - Works independently without framework dependencies
  • Universal Integration - Compatible with any FiveM server setup
  • Role-Based Access - Restrict weapon access by Discord roles
  • Real-Time Verification - Check Discord roles when equipping weapons
  • Webhook Notifications - Discord notifications for weapon access
  • API Management - Handle Discord API connections and authentication
  • Weapon Management - Integrate with existing weapon systems
  • Permission Systems - Connect with server permission management
  • Access Control - Enhance weapon security and access control
  • Custom Scripts - Perfect foundation for building role-based systems
  • Universal Compatibility - Works with any FiveM server setup
  • Performance Optimized - Efficient permission checking and validation
  • Easy Integration - Simple setup and configuration
[1] = {
SectionName = "Firearms units",
PermLockedWeapons = { -- List the weapons you wish to restrict. So: You need atleast 1 role from RequiredDiscordRoleOrGroupNames to wield the weapon in this list.
"WEAPON_COMBATPISTOL",
"WEAPON_ASSAULTRIFLE",
},
RequiredDiscordRoleOrGroupNames = {
"SWAT",
"AFO",
"DSI",
"BSB",
"MARSOF",
-- Add more roles if you like.
},
},
[2] = {
SectionName = "Sniper units",
PermLockedWeapons = {
"WEAPON_SNIPERRIFLE",
"WEAPON_HEAVYSNIPER",
"WEAPON_HEAVYSNIPER_MK2",
"WEAPON_MARKSMANRIFLE",
"WEAPON_MARKSMANRIFLE_MK2",
},
RequiredDiscordRoleOrGroupNames = {
"SWAT",
"AFO",
"DSI",
"BSB",
"MARSOF",
-- Add more roles if you like.
},
},
[3] = {
SectionName = "Server banned weapons",
PermLockedWeapons = {
"WEAPON_RPG",
"WEAPON_HOMINGLAUNCHER",
"WEAPON_RAILGUN",
"WEAPON_MINIGUN",
"WEAPON_RAYMINIGUN"
},
RequiredDiscordRoleOrGroupNames = {
-- None..
-- "Manager", -- or
-- "Senior_Admin", -- or
-- Add more roles if you like.
},
},
  • Enable Debug Mode - Turn on debug in config.lua for detailed logging
  • Check F8 Console - Look for weapon access logs and error messages
  • Verify Discord Roles - Ensure roles are correctly assigned
  • Test Weapon Access - Try equipping weapons with proper roles
  • Check File Permissions - Ensure all files are accessible
  • Clear Role Structure - Design logical Discord role hierarchy
  • Role Permissions - Assign appropriate weapon access to roles
  • Role Verification - Regularly verify Discord role assignments
  • Access Control - Implement proper role-based access control
  • Weapon Lists - Organize weapons by role requirements
  • Weapon Names - Use correct weapon names in configuration
  • Testing - Thoroughly test weapon access with different roles
  • Documentation - Document weapon-role assignments
  • API Configuration - Properly configure Discord API settings
  • Webhook Setup - Set up Discord webhooks for notifications
  • Bot Permissions - Ensure Discord bot has necessary permissions
  • API Monitoring - Monitor Discord API connection status
  • Role Verification - Implement secure Discord role checking
  • Access Logging - Log weapon access attempts and permissions
  • Error Handling - Handle Discord API failures gracefully
  • User Communication - Provide clear feedback for access denials

Watch the installation tutorial:

Installation Tutorial

Read through the instructions again if you have not managed to install the resource. Can’t get it to work still? Create a ticket through our dedicated support system in Discord:

Nights Software Discord