engineSetElementTexture
Client
Swaps a texture on one vehicle, ped, player or object alone. Other instances of the same model keep their textures.
bool engineSetElementTexture(element element, string name, texture|dui|bool source [, int priority = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The vehicle, ped, player or object. |
| name | string | The texture name its materials use, or a glob pattern. |
| source | texture|dui|bool | A texture, a dui, or false to hide the texture. |
| priority | int | Among several swaps for the same texture, the highest priority answers; among equals, the newest.default 0 |
Returns
true once the swap is set. Raises an error if the element is not a vehicle, ped, player or object, or the source is not an image or false.
The swap is kept while the element lives, whether it is streamed in or out. An element's swaps answer before the model's (engineSetModelTexture) and the world's (engineSetWorldTexture).
Example
local vehicle = createVehicle("infernus", 1544.0, -1675.0, 13.6)
local lights = engineCreateTexture("images/lights.png")
engineSetElementTexture(vehicle, "vehiclelights128", lights)