SetLightColor - GalaxHD551/lightstreamer GitHub Wiki

Description

Sets the color of a given light.

Syntax

lr.SetLightColor(lightid, color)

Parameters

  • lightid

    The light identifier.

  • color

    The color as an integer value

Return Value

  • Returns true on success.

Exemple

lr = ImportPackage("lightstreamer")

function cmd_light(player, r, g, b)
	local x, y, z = GetPlayerLocation(player)
        lightid = lr.CreateLight("POINTLIGHT", x, y, z)
        Delay(function()
                local color = RGB(r, g, b)
        	lr.SetLightColor(lightid, color)
		AddPlayerChat(player, "The light color was updated")
	end, 1500)
	
end
AddCommand("light", cmd_light)