setLightColor | Multi Theft Auto: Wiki Skip to content

setLightColor

Client-side
Server-side
Shared

Pair: getLightColor

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the color for a light element.

OOP Syntax Help! I don't understand this!

  • Method:light:setColor(...)
  • Variable: .color

Syntax

bool setLightColor ( light theLight, float r, float g, float b )
Required Arguments
  • theLight: The light that you wish to set the color of.
  • r: MISSING_PARAM_DESC
  • g: MISSING_PARAM_DESC
  • b: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the function was successful, false otherwise.

Code Examples

shared
local light = createLight(1, 2, 3, 4)
addCommandHandler("setcoloroflight",
function(cmd, r, g, b)
if r and g and b then
setLightColor(light, tonumber(r), tonumber(g), tonumber(b))
end
end
)