Vehicle.getUniqueId 64

Get unique identifier for the vehicle. This is useful to check if a vehicle already exist, or to find specific vehicle with findVehicle, especially across the network or between different phases.


Return value

Return TypeDescription
integerA unique ID for the vehicle, Nil if not found.

No parameters defined for this function.


Examples

Example 171

-- Spawn a vehicle
local vehicle = spawnVehicle("JeepWillys", vec3(0, 1.5, 0), vec3(0, 90, 0)) 
-- Acquire the unique id of the spawned vehicle
local vehicleUniqueId = vehicle.getUniqueId()

Back to Scripting API