M MY Multiplayer: Wiki
Side
Kind

setLightColor

Client

Changes a light's colour.

bool setLightColor(light light, color color)

Parameters

NameTypeDescription
lightlightThe light.
colorcolorThree numbers r, g, b (integers from 0 to 255) or a tocolor value. Alpha is ignored.

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)
setTimer(function()
    setLightColor(light, math.random(0, 255), math.random(0, 255), math.random(0, 255))
end, 500, 0)

See also