VehicleService
Noir.Services.VehicleService: NoirService
A service for interacting with vehicles.
Note that vehicles are referred to as bodies, while vehicle groups are referred to as vehicles.
Load all saved vehicles. It is important bodies are loaded beforehand. If this is not the case, they will be created automatically but possibly with incorrect data.
Used internally.
Load all saved bodies.
Used internally.
Register a vehicle to the vehicle service.
Used internally.
Parameters
ID
: integerplayer
: NoirPlayer|nilspawnPosition
: SWMatrixcost
: numberfireEvent
: boolean
Returns
NoirVehicle|nil
Save a vehicle.
Used internally.
Parameters
vehicle
: NoirVehicle
Unsave a vehicle.
Used internally.
Parameters
vehicle
: NoirVehicle
Unregister a vehicle from the vehicle service.
Used internally.
Parameters
vehicle
: NoirVehiclefireEvent
: boolean
Register a body to the vehicle service.
Used internally.
Parameters
ID
: integerplayer
: NoirPlayer|nilspawnPosition
: SWMatrixcost
: numberfireEvent
: boolean
Returns
NoirBody|nil
Save a body.
Used internally.
Parameters
body
: NoirBody
Unsave a body.
Used internally.
Parameters
body
: NoirBody
Load a body internally.
Used internally.
Parameters
body
: NoirBodyfireEvent
: boolean
Unload a body internally.
Used internally.
Parameters
body
: NoirBodyfireEvent
: boolean
Fire events for body damage.
Used internally.
Parameters
body
: NoirBodyx
: numbery
: numberz
: numberdamage
: number
Unregister a body from the vehicle service.
Used internally.
Parameters
body
: NoirBodyautoDespawnParentVehicle
: booleanfireEvent
: boolean
Spawn a vehicle.
Uses server.spawnAddonVehicle
under the hood.
Parameters
componentID
: integerposition
: SWMatrixaddonIndex
: integer|nil - Defaults to this addon's index
Returns
NoirVehicle|nil
Get a vehicle from the vehicle service.
Parameters
ID
: integer
Returns
NoirVehicle|nil
Get a body from the vehicle service.
Parameters
ID
: integer
Returns
NoirBody|nil
Get all spawned vehicles.
Returns
table<integer, NoirVehicle>
Get all spawned bodies.
Returns
table<integer, NoirBody>
Get all bodies spawned by a player.
Parameters
player
: NoirPlayer
Returns
table<integer, NoirBody>
Get all vehicles spawned by a player.
Parameters
player
: NoirPlayer
Returns
table<integer, NoirVehicle>
Last updated