M MY Multiplayer: Wiki
Side
Kind

engineRestoreElementOverlay

Client

Undoes what this resource's engineSetElementOverlay did of a single vehicle, ped or object.

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

Parameters

NameTypeDescription
elementelementA vehicle, ped, player or object.
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 the layers made with this material. Without it, any.default nil

Returns

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

Example

local highlight = engineCreateMaterial("surface_emissive")
local crate = createObject("trafficcone", 2490.0, -1670.0, 13.3)
engineSetElementOverlay(crate, "*", highlight)

setTimer(function()
    engineRestoreElementOverlay(crate)
end, 5000, 1)

See also