setLightEnabled
Client
Turns a light on or off without destroying it.
bool setLightEnabled(light light, bool enabled)
Parameters
| Name | Type | Description |
|---|---|---|
| light | light | The light. |
| enabled | bool | true 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)