M MY Multiplayer: Wiki
Side
Kind

setElementComponentRotation

Client

Turns a vehicle's or object's component. The change applies on this client only.

bool setElementComponentRotation(vehicle|object element, string component, float rx, ry, rz [, string base = "parent"])

Parameters

NameTypeDescription
elementvehicle|objectThe vehicle or object.
componentstringThe component's name, as getElementComponents lists it.
rx, ry, rzfloatThe new rotation in degrees, as three numbers or one vec3.
basestringRelative to what: "world", "root" (the element itself) or "parent" (the component's parent frame). Case does not matter.default "parent"

Returns

true.

The rotation is kept while the element exists, and comes back when it streams in again.

Example

local vehicle = getPedOccupiedVehicle(localPlayer)
if vehicle then
    setElementComponentRotation(vehicle, "wheel_lf_dummy", 0, 0, 30)
end
Coming from MTAThe same as MTA's setVehicleComponentRotation, but it also works on objects.
NoteReturns true even when the component does not exist. Check the name with getElementComponents.

See also