CreateLight - GalaxHD551/lightstreamer GitHub Wiki

Description

This function creates a light at a desired location. See light type for a list of usable light type.

Syntax

lr.CreateLight(lighttype, x, y, z[, rx, ry, rz, color, intensity, streamradius])

Parameters

  • lighttype

    The light type for which light to spawn.

  • x

    X coordinate

  • y

    Y coordinate

  • z

    Z coordinate

  • rx (optional)

    the rotation X axis

  • ry (optional)

    the rotation Y axis

  • rz (optional)

    the rotation Z axis

  • color (optional)

    the color as an integer

  • intensity (optional)

    the light intensity in integer

  • streamradius (optional)

    the radius where the light will be streamed for the player

Return Value

  • Returns an identifier to the new light. false on error.

Exemple

lr = ImportPackage("lightstreamer")

function cmd_light(player)
	local x, y, z = GetPlayerLocation(player)
        lightid = lr.CreateLight("POINTLIGHT", x, y, z)
	
end
AddCommand("light", cmd_light)