Lighting

Inherits Instance

Properties

Brightness

number

The overall brightness multiplier for lighting

GeographicLatitude

number

The geographic latitude used for sun position calculations (in degrees)

ClockTime

number

The time of day in hours (0-24), used for sun position

Parent

Instance | nil Inherited from Instance

The parent of this instance in the hierarchy

Archivable

bool Inherited from Instance

When true, the instance can be saved and cloned

Name

string Inherited from Instance

The name of this instance

ClassName

string Read-only Inherited from Object

The name of this object's class

Methods

Ambient()

void

The ambient light color applied to all surfaces

GetSunDirection()

Vector3

Returns the direction vector of the sun.

AddTag(tag: string)

void Inherited from Instance

Adds a tag to this instance

Parameters:

  • tag string

HasTag(tag: string)

bool Inherited from Instance

Checks if this instance has a specific tag

Parameters:

  • tag string

RemoveTag(tag: string)

void Inherited from Instance

Removes a tag from this instance

Parameters:

  • tag string

GetAttribute(attribute: string)

Attribute | nil Inherited from Instance

Gets the value of an attribute

Parameters:

  • attribute string

GetAttributes()

table Inherited from Instance

Returns a table of all attributes

SetAttribute(attribute: string, value: Attribute)

void Inherited from Instance

Sets the value of an attribute

Parameters:

  • attribute string
  • value Attribute
part:SetAttribute("Health", 100)
local health = part:GetAttribute("Health")

FindFirstAncestor(name: string)

Instance | nil Inherited from Instance

Finds the first ancestor with the specified name

Parameters:

  • name string

FindFirstAncestorOfClass(className: string)

Instance | nil Inherited from Instance

Finds the first ancestor of the specified class

Parameters:

  • className string

FindFirstAncestorWhichIsA(className: string)

Instance | nil Inherited from Instance

Finds the first ancestor that is an instance of the class

Parameters:

  • className string

FindFirstChild(name: string)

Instance | nil Inherited from Instance

Finds the first direct child with the specified name

Parameters:

  • name string

FindFirstChildOfClass(name: string)

Instance | nil Inherited from Instance

Finds the first direct child of the specified class

Parameters:

  • name string

FindFirstChildWhichIsA(name: string)

Instance | nil Inherited from Instance

Finds the first child that is an instance of the class

Parameters:

  • name string

FindFirstDescendant(name: string)

Instance | nil Inherited from Instance

Finds the first descendant with the specified name

Parameters:

  • name string

GetChildren()

table Inherited from Instance

Returns an array of all direct children

for _, child in ipairs(workspace:GetChildren()) do
print(child.Name)
end

GetDescendants()

table Inherited from Instance

Returns an array of all descendants

IsAncestorOf(descendant: Instance)

bool Inherited from Instance

Checks if this instance is an ancestor of the target

Parameters:

  • descendant Instance

IsDescendantOf(ancestor: Instance)

bool Inherited from Instance

Checks if this instance is a descendant of the target

Parameters:

  • ancestor Instance

ClearAllChildren()

void Inherited from Instance

Removes and destroys all children

Destroy()

void Inherited from Instance

Permanently destroys this instance and all descendants

SetParent(newParent: Instance)

void Inherited from Instance

Sets the parent of this instance

Parameters:

  • newParent Instance - | nil

AddChild(child: Instance)

void Inherited from Instance

Adds a child to this instance

Parameters:

  • child Instance

RemoveChild(child: Instance)

void Inherited from Instance

Removes a child from this instance

Parameters:

  • child Instance

IsA(className: string)

bool Inherited from Object

Checks if this object is an instance of the specified class

Parameters:

  • className string

FirePropertyChanged(propertyName: string)

void Inherited from Object

Triggers the Changed event for a specific property

Parameters:

  • propertyName string

Events

AncestryChanged

Event(child: Instance, parent: Instance) Inherited from Instance

Fires when the instance's ancestry changes

AttributeChanged

Event(attributeName: string) Inherited from Instance

Fires when an attribute is changed

ChildAdded

Event(child: Instance) Inherited from Instance

Fires when a child is added to this instance

ChildRemoved

Event(child: Instance) Inherited from Instance

Fires when a child is removed from this instance

DescendantAdded

Event(descendant: Instance) Inherited from Instance

Fires when a descendant is added anywhere in the tree

DescendantRemoving

Event(descendant: Instance) Inherited from Instance

Fires when a descendant is about to be removed

Destroying

Event() Inherited from Instance

Fires when this instance is being destroyed

Changed

Event(propertyName: string) Inherited from Object

Fires when a property of this object changes

part.Changed:Connect(function(property)
print("Property changed:", property)
end)