Skip to content
M2O Scripting APIScripting reference
Runtime classClient APIGenerated

Vehicle

Defined in: client/api.d.ts:1012

Client handle for a streamed M2O vehicle.

  • Entity

new Vehicle(id): Vehicle

Defined in: client/api.d.ts:1017

Creates a script wrapper for an existing streamed vehicle with this ID; it does not spawn a vehicle.

number

Network entity identifier.

Vehicle

getPartTransform(partId): BoneTransform | null

Defined in: client/api.d.ts:1030

Resolves the current world-space transform of a named vehicle part.

number

Numeric part identifier, typically obtained from the global VehiclePart table.

BoneTransform | null

The part transform, or null when the vehicle or requested part is unavailable.


setVirtualWorld(world): void

Defined in: shared.d.ts:83

number

void


setVisibleTo(player): void

Defined in: shared.d.ts:84

Entity | null

void


toString(): string

Defined in: client/api.d.ts:1023

Returns a readable representation of this vehicle handle.

string

The vehicle ID formatted for logging or debugging.

readonly id: number

Defined in: shared.d.ts:79


position: Vector3

Defined in: shared.d.ts:81


rotation: Vector3 | Quaternion

Defined in: shared.d.ts:82


readonly virtualWorld: number

Defined in: shared.d.ts:80