Light
Defined in: server/api.d.ts:4406
Replicated point light that illuminates its surroundings.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Light(
id):Light
Defined in: server/api.d.ts:4411
Creates a handle for an existing entity.
Parameters
Section titled “Parameters”number
Network entity identifier.
Returns
Section titled “Returns”Light
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: server/api.d.ts:4441
Removes this light from every client. Safe to repeat.
Returns
Section titled “Returns”void
setVirtualWorld()
Section titled “setVirtualWorld()”setVirtualWorld(
world):void
Defined in: server/api.d.ts:9890
Moves this entity into another virtual world.
Parameters
Section titled “Parameters”number
Virtual-world identifier used to partition replication and visibility.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”setVisibleTo()
Section titled “setVisibleTo()”setVisibleTo(
player):void
Defined in: server/api.d.ts:9896
Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.
Parameters
Section titled “Parameters”player
Section titled “player”Entity | null
Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”toString()
Section titled “toString()”toString():
string
Defined in: server/api.d.ts:9884
Formats this entity handle for logging and debugging.
Returns
Section titled “Returns”string
Text containing the network entity ID.
Inherited from
Section titled “Inherited from”spawn()
Section titled “spawn()”
staticspawn(position,options?):Light
Defined in: server/api.d.ts:4449
Creates a persistent point light, streamed to nearby players including late arrivals. Removed when its creating script resource stops. Exported world lights are owned by the server.
Parameters
Section titled “Parameters”position
Section titled “position”Vector3 | { x: number; y: number; z: number; }
World-space position in metres.
options?
Section titled “options?”RGB color 0..1, intensity 0..100 and radius 0.1..100 metres. Defaults to warm orange, intensity 1, radius 5 and castShadows false. Set castShadows to true for native shadows.
castShadows?
Section titled “castShadows?”boolean
color?
Section titled “color?”Vector3 | { x: number; y: number; z: number; }
intensity?
Section titled “intensity?”number
radius?
Section titled “radius?”number
Returns
Section titled “Returns”Light
The new light handle.
Properties
Section titled “Properties”castShadows
Section titled “castShadows”castShadows:
boolean
Defined in: server/api.d.ts:4436
Whether this light casts native shadows. False by default; only booleans are accepted.
color:
Vector3
Defined in: server/api.d.ts:4421
RGB color using x, y and z, each from 0 to 1. Invalid values throw before mutation.
readonlyid:number
Defined in: server/api.d.ts:9858
Immutable network entity identifier.
Inherited from
Section titled “Inherited from”intensity
Section titled “intensity”intensity:
number
Defined in: server/api.d.ts:4426
Diffuse intensity multiplier, from 0 to 100. Invalid values throw before mutation.
position
Section titled “position”position:
Vector3
Defined in: server/api.d.ts:4416
World-space position in metres. Invalid positions throw before mutation.
Inherited from
Section titled “Inherited from”radius
Section titled “radius”radius:
number
Defined in: server/api.d.ts:4431
Light radius in metres, from 0.1 to 100. Invalid values throw before mutation.
rotation
Section titled “rotation”rotation:
Vector3|Quaternion
Defined in: server/api.d.ts:9873
Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.
Inherited from
Section titled “Inherited from”
readonlystate:StateBag
Defined in: server/api.d.ts:9878
Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.
Inherited from
Section titled “Inherited from”virtualWorld
Section titled “virtualWorld”
readonlyvirtualWorld:number
Defined in: server/api.d.ts:9863
Current virtual-world identifier.