Overview
Updated
Raze_NPCAI
Raze_NPCAI gives civilians in FiveM an actual voice and lets officers speak to them naturally instead of relying only on menus and preset dialogue.
The script is built to work alongside ERS, not replace it. ERS still handles the actual NPC, callout, inventory, licenses and police interactions. Raze_NPCAI reads that information so the NPC can understand what is happening around them and respond based on the situation they are actually involved in.
What Raze_NPCAI Does
Live AI Conversations
Players can walk up to supported NPCs, hold their talk key and have a live conversation with them.
NPC responses are generated using AI and spoken through ElevenLabs, allowing conversations to feel much more natural than repeating the same preset voice lines.
NPCs can also remember parts of the conversation so they are less likely to contradict something they just told you.
NPCs Understand Their Situation
NPCs are given information about what is currently happening around them.
Depending on the situation, they can understand things such as:
- Their identity
- Their role in an ERS callout
- Whether they are a suspect, victim, witness or other involved person
- Their license information
- Items found on them
- Weapons they are currently holding
- Weapons they recently dropped
- Recent conversations with the officer
- Actions that have already been performed on them
This allows conversations to stay connected to what is actually happening in-game.
For example, a suspect involved in a callout can respond differently from a random civilian or witness instead of every NPC acting the same.
Voice Commands
Raze_NPCAI can recognize spoken police commands while you are talking to an NPC.
Supported interactions include commands for things such as:
- Put your hands up
- Kneel down
- Exit the vehicle
- Search
- Cuff
- Uncuff
- Release
- Take into custody
The command system is designed to understand different ways of saying the same thing. You do not need to repeat one exact sentence every time for a command to work.
NPC command states are also maintained during conversations. For example, an NPC that has surrendered should not simply drop their hands because you continued speaking to them.
ERS Integration
Raze_NPCAI uses ERS wherever possible for actual gameplay actions.
This means NPCAI is not creating a second inventory, warrant, license or custody system behind ERS. Instead, it reads and works with the information ERS already has.
ERS integration currently includes:
- NPC identity information
- Inventory awareness
- License awareness
- Callout information
- Suspect, victim and witness roles
- Surrender and kneeling
- Cuffing and uncuffing
- Searching
- Releasing NPCs
- Custody actions
- Vehicle exit interactions
- ERS-based flee chances during certain interactions
This helps keep the NPC's conversation and actual gameplay state in sync.
NPC Memory
NPCs have short-term conversation and situation memory.
They can remember things such as:
- Information they recently gave an officer
- Their current story
- Important parts of the conversation
- Weapons they recently had or dropped
- Commands they have already followed
- Their involvement in the current situation
This helps prevent conversations from completely resetting every time the player speaks.
Spatial Voice
NPC audio is positional.
You hear the NPC from their location in the world instead of their voice simply playing globally for everyone nearby.
The system also handles nearby players so conversations feel like they are actually happening around the NPC.
Push-to-Talk
The default key for speaking to an NPC is N.
Players are not locked to that key. It can be changed normally through:
FiveM → Settings → Key Bindings → FiveM
Look for the Raze_NPCAI talk key and bind it to whatever key you prefer.
What You Need
Raze_NPCAI requires an ElevenLabs API key for AI voice playback.
The resource also uses the RazeScripts activation system to verify that the server has access to the product.
Both normal purchases and manually granted product access are supported.
Getting Started
For a new installation, follow the documentation in this order:
- Installation
- ElevenLabs Setup
- Server Activation
Once those are complete, start the resource and test a conversation with an NPC in-game.
Something missing or unclear?
Ask in Discord ↗