ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setVehicleComponentTransform

Function

setVehicleComponentTransform

ServerVehiclesTrilogy Hub only

Stores the position, rotation and scale of a model part in one call. Each of the three arguments is a vector or a { x, y, z } table; an omitted one (nil) stays unchanged.

Syntax

bool setVehicleComponentTransform(vehicle vehicle, string component [, table position = nil, table rotation = nil, table scale = nil])

Arguments

vehiclevehicle
The vehicle.
componentstring
Part name.
positiontable, optional = nil
Offset { x, y, z } in metres.
rotationtable, optional = nil
Rotation { x, y, z } in degrees.
scaletable, optional = nil
Scale { x, y, z }.

Returns

true on success.

Example

local vehicle = createVehicle(411, 2000, -1690, 13.5)
setVehicleComponentTransform(vehicle, "bonnet_dummy", { 0, 0, 0.1 }, { 30, 0, 0 }, nil)

Notes

State for scripts. The model does not change (see setVehicleComponentPosition).

See also