Skip to content

← Previous | Next →


NPC

Description

Creates an NPC in the world that can be interacted with a defined behaviour tree.

Attributes


Attribute name

Name Required Description Parameters
name Yes The name of the NPC and ID. 1

Parameters of name

# Name Type Description Multiple
1 Name String The name of the NPC. No

Attribute model

Name Required Description Parameters
model Yes The model of the NPC. 1

Parameters of model

# Name Type Description Multiple
1 Model String The model of the NPC https://docs.fivem.net/docs/game-references/ped-models/ No

Attribute position

Name Required Description Parameters
position Yes The position of the NPC. 4

Parameters of position

# Name Type Description Multiple
1 X Number The X position of the NPC. No
2 Y Number The Y position of the NPC. No
3 Z Number The Z position of the NPC. No
4 Heading Number The heading of the NPC. No

Attribute floating

Name Required Description Parameters
floating No The offset of the floating message. 3

Parameters of floating

# Name Type Description Multiple
1 X Number The X offset of the floating message. No
2 Y Number The Y offset of the floating message. No
3 Z Number The Z offset of the floating message. No

Attribute marker

Name Required Description Parameters
marker No The marker of the NPC. 20

Parameters of marker

# Name Type Description Multiple
1 Model number Number The model number as defined in FiveM https://docs.fivem.net/docs/game-references/markers/ No
2 X Number The X position of the marker. No
3 Y Number The Y position of the marker. No
4 Z Number The Z position of the marker. No
5 ScaleX Number The X scale of the marker. No
6 ScaleY Number The Y scale of the marker. No
7 ScaleZ Number The Z scale of the marker. No
8 DirX Number The X direction of the marker. No
9 DirY Number The Y direction of the marker. No
10 DirZ Number The Z direction of the marker. No
11 RotX Number The X rotation of the marker. No
12 RotY Number The Y rotation of the marker. No
13 RotZ Number The Z rotation of the marker. No
14 R Number 0-255 The R color of the marker. No
15 G Number 0-255 The G color of the marker. No
16 B Number 0-255 The B color of the marker. No
17 A Number 0-255 The A color of the marker. No
18 upAndDown Boolean The up and down of the marker. No
19 faceCamera Boolean The face camera of the marker. No
20 rotate Boolean The rotate of the marker. No

Attribute blip

Name Required Description Parameters
blip No The blip of the NPC. 3

Parameters of blip

# Name Type Description Multiple
1 Name String The name of the blip in the map. No
2 Sprite Number The sprite of the blip as defined in https://docs.fivem.net/docs/game-references/blips/#blips. No
3 Color Number The color of the blip as defined in https://docs.fivem.net/docs/game-references/blips/#blip-colors. No

Attribute interaction

Name Required Description Parameters
interaction Yes The interaction behaviour tree of the NPC. 1

Parameters of interaction

# Name Type Description Multiple
1 InteractionBehaviourTree BehaviourTree The interaction tree of the NPC. No

Attribute behaviour

Name Required Description Parameters
behaviour Yes The behaviour tree of the NPC. 1

Parameters of behaviour

# Name Type Description Multiple
1 BehaviourTree BehaviourTree The behaviour tree of the NPC. No

Example


  NPC 

  name old_man 
  model s_f_m_maid_01 
  position -1020.72 4839.78 258.30 0.0 

  interaction 
    tell "Hi, how are you?" 

  behaviour 
    wander -1020.72 4839.78 258.30 10 5 5