M MY Multiplayer: Wiki
Side
Kind

engineRestoreModelMaterial

Client

Undoes what this resource's engineSetModelMaterial did of every instance of a model.

bool engineRestoreModelMaterial(string|element model [, int|string selector = nil, material material = nil])

Parameters

NameTypeDescription
modelstring|elementThe model's name or a model element.
selectorint|stringOnly what was picked with this selector (the same index or name). With material, it also takes a name a wildcard caught out of that material. Without it, everything.default nil
materialmaterialOnly what was replaced with this material. Without it, any.default nil

Returns

true if something was undone, false if there was nothing to undo.

Example

local chrome = engineCreateMaterial("surface")
engineSetModelMaterial("infernus", "*chrome*", chrome)

addCommandHandler("nochrome", function()
    engineRestoreModelMaterial("infernus")
end)

See also