M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
selectorint|stringWhich material: its index from 1 or its name, as engineGetModelMaterials lists them. The name ignores case and takes the * and ? wildcards.
materialmaterialThe material drawn in their place.
targetsstringWhich models it reaches: world, vehicle and ped, split by spaces or commas.default world vehicle
priorityintWhen 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")

See also