Light
Point lights. On the server, Light.spawn adds a light all players see, including later joiners, until you destroy it or its resource stops, though a world export's lights stay. In a client script, only that player sees it, until destroy(), the resource stops or the world changes. Both sides check the same limits: each colour channel 0 to 1, intensity 0 to 100, radius 0.1 to 100 m. A bad value throws and changes nothing. A game shows at most 192 lights, counting both server and client ones.
light.spawn()
Light.spawn(position, options)Adds a point light. On a client, it throws if the game already shows 192 script lights. Defaults are warm orange { x: 1, y: 0.6, z: 0.3 }, intensity 1, radius 5 and no shadows.
light.position
positionIts location in metres. Assign a Vector3 or { x, y, z } to move it for all players.
light.color
colorRed, green and blue in x, y and z, each 0 to 1. You can assign to it.
light.intensity
intensityBrightness from 0, dark, to 100, as a multiplier on the colour. You can assign to it.
light.radius
radiusIts reach, 0.1 to 100 metres. You can assign to it.
light.castShadows
castShadowsWhether it casts shadows, false by default. It accepts only true or false, and the game's shadow settings decide whether a player sees them.
light.destroy()
destroy()Removes the light from all games. It is safe to call twice.
light.valid
validClient only. Whether the light still shines. It is false after destroy(), when its resource stopped, or when the game dropped it because of a world change or lack of room. A removed light keeps its last values for reading, and assigning does nothing.
light.id
id: numberOn the server, the network id. On a client, this game's own id for the light, which is not a network id.