M MY Multiplayer: Wiki
Side
Kind

setLightEnabled

Client

Turns a light on or off without destroying it.

bool setLightEnabled(light light, bool enabled)

Parameters

NameTypeDescription
lightlightThe light.
enabledbooltrue to turn it on, false to turn it off.

Returns

true if it changed. With a wrong argument it logs a warning and returns false.

Example

local light = createPointLight(2495.1, -1687.4, 14.5, 12)
bindKey("l", "down", function()
    setLightEnabled(light, not isLightEnabled(light))
end)

See also