A comprehensive FiveM resource that allows players to take NPCs as hostages with realistic animations, looting, and advanced interaction capabilities. Inspired by popular roleplay mechanics.
-
Hostage System
- Realistic take-down and holding animations
- NPCs can surrender or resist
- Handcuffing system for subdued NPCs
- Dynamic NPC reactions to hostage situations
-
Looting System
- Configurable loot tables with weighted chances
- Money, items, and special drops
- Blacklist system for restricted items
- Inventory integration (supports ESX, QBCore, ox_inventory)
-
Police Integration
- Automatic police alerts with blips
- Configurable response teams
- Wanted level integration
- NPC witnesses that can call the police
-
Framework Support
- ESX (Legacy and New Version)
- QBCore
- Standalone mode (limited features)
- ox_lib integration for enhanced UI
-
Customization
- Fully configurable animations
- Adjustable interaction distances
- Permission system with job restrictions
- Multi-language support
- OX Lib
- OX Target (Recommended)
- ESX Legacy or QBCore
- ox_inventory or qb-inventory
- Download the latest release
- Place the
Alpha_NpcIntreactionfolder in yourresourcesdirectory - Add
ensure Alpha_NpcIntreactionto yourserver.cfg - Configure
config.luato match your server's needs - Add any required dependencies to your
server.cfg - Restart your server
- ox_lib (Recommended for best experience)
- ox_target (Optional but recommended)
- ESX or QBCore (Optional, but required for full functionality)
Edit the config.lua file to customize the script:
- Change the framework (
esxorqb) - Adjust interaction distances and keybinds
- Configure loot settings and blacklists
- Set up notifications and permissions
- Enable/disable features as needed
- Aim at an NPC with a weapon (or use the interaction key)
- The NPC will raise their hands in surrender
- Approach and press the interaction key (default: E) to take them hostage
- While holding the hostage:
E- Release the hostageG- Search the hostage for itemsH- Execute the hostage (if enabled)F- Handcuff the hostage (requires handcuff item)
- Surrendering NPCs: NPCs will surrender when aimed at with a weapon
- Witness System: Nearby NPCs may call the police or flee
- Struggle Mechanic: Hostages may try to escape or fight back
- Police Response: Automatic alerts with location blips for law enforcement
- Inventory Integration: Loot goes directly to player's inventory
- When looting a hostage, you'll receive random items based on the configuration
- Some NPCs may have better loot than others
- Items are added directly to your inventory if there's space
- Configure which jobs can take hostages in the config
- Set up admin commands for special permissions
Edit config.lua to customize:
-- Framework and Menu System
Config.Framework = 'esx' -- 'esx', 'qb', or 'standalone'
Config.Menu = 'ox_lib' -- 'ox_lib', 'esx_menu_default', or 'qb-menu'
-- Interaction Settings
Config.Distance = 2.0
Config.UseOxTarget = true
-- Loot System
Config.Loot = {
enabled = true,
minItems = 1,
maxItems = 3,
items = {
{item = "water", chance = 30, min = 1, max = 2, label = "Water"},
{item = "money", chance = 50, min = 50, max = 500, label = "Cash"},
-- Add more items as needed
}
}
-- Police Integration
Config.Police = {
enabled = true,
requiredCops = 1,
jobs = {'police', 'sheriff'}
}/releasehostage- Release current hostage (if any)/hostagestatus- Check current hostage status
/givehostageitem [playerId] [item] [count]- Give items to a player/sethostagejob [job]- Set required job for taking hostages/toggledebug- Toggle debug mode (admin only)
-- Check if player is currently holding a hostage
exports['Alpha_NpcIntreaction']:IsHostageTaker()
-- Check if player is currently a hostage
exports['Alpha_NpcIntreaction']:IsHostage()
-- Get current hostage entity
exports['Alpha_NpcIntreaction']:GetCurrentHostage()
-- Force release current hostage
exports['Alpha_NpcIntreaction']:ReleaseHostage()
-- Check if a player is currently a hostage
exports['Alpha_NpcIntreaction']:IsPlayerHostage(playerId)
-- Check if a player is currently taking a hostage
exports['Alpha_NpcIntreaction']:IsPlayerTakingHostage(playerId)For support, please create an issue on GitHub.
This project is licensed under the MIT License - see the LICENSE file for details.
- [Nithish] - Initial work