M MY Multiplayer: Wiki
Side
Kind

engineRestoreWorldMaterial

Client

Undoes what this resource's engineSetWorldMaterial did of every model in the world.

bool engineRestoreWorldMaterial([int|string selector = nil, material material = nil])

Parameters

NameTypeDescription
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 wet = engineCreateMaterial()
engineSetWorldMaterial("*road*", wet)

addCommandHandler("dry", function()
    engineRestoreWorldMaterial("*road*")
end)

See also