SetLightAttenuationRadius - GalaxHD551/lightstreamer GitHub Wiki

Description

The Attenuation Radius of the light does a few major things:

  1. Sets the reach of the light.

  2. Defines what objects it will affect.

  3. Serves as the outer bounds when calculating the falloff of the light.

Light Attenuation Radius can have a serious impact on performance, so use larger radius values sparingly.

Syntax

lr.SetLightAttenuationRadius(lightid, radius)

Parameters

  • lightid

    The light identifier.

  • radius

    The attenuation radius.

Return Value

  • Returns true on success.

Exemple

lr = ImportPackage("lightstreamer")

function cmd_light(player)
	local x, y, z = GetPlayerLocation(player)
        lightid = lr.CreateLight("SPOTLIGHT", x, y, z)
        Delay(function()
        	lr.SetLightAttenuationRadius(lightid, 800)
		AddPlayerChat(player, "The attenuation radius has been improved")
	end, 1500)
	
end
AddCommand("light", cmd_light)