Custom NPC
It is possible to add custom NPCs to perform different events. For example, if you want to create an NPC to attend users in the bank, or for any other event.
Adding Custom NPCs
To add a custom NPC, add it in the CustomNPC section inside the config.lua following these parameters:
[1] = {
ui = {
dialog = "Welcome to Fleca, do you want to make any operation in your bank account? Maybe withdraw or deposit money?",
title = "Bank",
button1 = "Yes, I want to perform an operation",
button2 = "No, maybe another time",
useAudio = true
},
npc = {
ped = "u_m_y_gunvend_01",
location = vector4(148.18, -1041.63, 29.37, 342.36),
animation = "WORLD_HUMAN_CLIPBOARD"
},
event = {
type = "client",
triggerevent = "qb-banking:openBankScreen",
args = {}
}
}
Configuration Parameters
UI Section
- dialog: The text that the NPC will display when interacted with
- title: The title of the interaction window
- button1: Text for the positive action button
- button2: Text for the negative action button
- useAudio: Set to
trueto use audio files for the NPC
NPC Section
- ped: The model name of the NPC (e.g., "u_m_y_gunvend_01")
- location: The exact coordinates and heading where the NPC will spawn (vector4)
- animation: The animation the NPC will perform while idle
Event Section
- type: The type of event trigger ("client" or "server")
- triggerevent: The name of the event to trigger
- args: Arguments to pass with the event (can be empty )
Use Cases
Custom NPCs can be used for:
- Bank attendants
- Store clerks
- Information points
- Job starters
- Quest givers
- Special interaction points
- Custom business interactions
You can create as many custom NPCs as needed for your server.