M MY Multiplayer: Wiki
Side
Kind

setVehicleWetnessLevel

Shared

Fixes how wet a vehicle looks, instead of following the rain.

bool setVehicleWetnessLevel(element element, float level)

Parameters

NameTypeDescription
elementelementA vehicle, or a parent element: every vehicle below it changes too.
levelfloatFrom 0 (dry) to 1 (soaked).

Returns

true if it changed, false if it is not a vehicle. Raises an error if level is outside 0 to 1.

To follow the weather again, use resetVehicleWetnessLevel. On the server, the change is sent to every client. On the client, it applies to this client only.

Example

local vehicle = createVehicle("sultan", 2490, -1670, 13.3)
setVehicleWetnessLevel(vehicle, 1)
NoteWith a parent element (such as root), every vehicle below changes, but the return value is the element's own, which is not a vehicle: false.

See also