← Previous | Next →
driveToEntity
Description
Makes the NPC drive a vehicle towards a specified entity.
Name | Type | Possibilities |
driveToEntity | behaviour | 2 |
Parameters
# | Name | Type | Mandatory | Description | Multiple |
1 | vehicle | Vehicle | Yes | The vehicle the NPC will drive. | No |
2 | entity | Entity | Yes | The entity to which the NPC will drive. | No |
3 | distance | number | No | The stopping distance from the entity. Defaults to 10.0 if not specified. | No |
4 | speed | number | No | The speed at which the NPC should drive. Defaults to 26.0 if not specified. | No |
5 | mode | number | No | The driving mode to use. Defaults to 786468 if not specified. See more details at https://vespura.com/fivem/drivingstyle/ | No |
Outputs
# | Description |
1 | The NPC is already within the specified distance from the entity. |
2 | The NPC starts driving towards the entity. |
Example
NPC
name TaxiDriver
model s_m_m_taxidriver_01
position -1020.72 4839.78 258.30 0.0
interaction
nothing
behaviour
getClosestPlayer player
getClosestVehicle vehicle
driveToEntity $vehicle $player