setLightIntensity
Client
Changes a light's brightness.
bool setLightIntensity(light light, float intensity)
Parameters
| Name | Type | Description |
|---|---|---|
| light | light | The light. |
| intensity | float | Brightness multiplier, from 0 to 1000. At 1, a white light shines with an HDR radiance of 12. |
Returns
true if it changed. With a wrong argument it logs a warning and returns false.
A new light starts at intensity 1.
Example
local light = createPointLight(2495.1, -1687.4, 14.5, 12)
addEventHandler("onClientRender", root, function()
setLightIntensity(light, 1 + math.sin(getTickCount() / 200) * 0.5)
end)