engineSetWorldMaterial
Client
Replaces the chosen materials of every model in the world with a material.
bool engineSetWorldMaterial(int|string selector, material material [, string targets = world vehicle, int priority = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| selector | int|string | Which material: its index from 1 or its name, as engineGetModelMaterials lists them. The name ignores case and takes the * and ? wildcards. |
| material | material | The material drawn in their place. |
| targets | string | Which models it reaches: world, vehicle and ped, split by spaces or commas.default world vehicle |
| priority | int | When several resources pick the same material, the highest priority wins; between equals, the newest.default 0 |
Returns
true when it was applied.
A material set for the model with engineSetModelMaterial wins over the world's.
Example
local wet = engineCreateMaterial()
engineSetMaterialValue(wet, "roughnessFactor", 0.1)
engineSetWorldMaterial("*road*", wet, "world")