GetLightLocation - GalaxHD551/lightstreamer GitHub Wiki

Description

Returns the light's XYZ location.

Syntax

lr.GetLightLocation(lightid)

Parameters

  • lightid

    The light identifier.

Return Value

  • The x, y, z vector of the light.

Exemple

lr = ImportPackage("lightstreamer")

AddEvent("OnPlayerSpawn", function(player)
	local x, y, z = GetPlayerLocation(player)
        local lightid = lr.CreateLight("SPOTLIGHT", 126016.046875, 81475.203125, 1550.0)
        local lx, ly, lz = lr.GetLightLocation(lightid)
        local distance = GetDistance3D(x, y, z, lx, ly, lz)
	AddPlayerChat(player, "Distance between you and the light is : "..distance.." cm.")	
end)