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
| Name | Type | Description |
|---|---|---|
| element | vehicle|object | The vehicle or object. |
| component | string | The component's name, as getElementComponents lists it. |
| rx, ry, rz | float | The new rotation in degrees, as three numbers or one vec3. |
| base | string | Relative 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)
endComing 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.