Added Function Variant Instance:GetAttribute(string attribute) Added Function RBXScriptSignal Instance:GetAttributeChangedSignal(string attribute) Added Function Dictionary Instance:GetAttributes() Added Function void Instance:SetAttribute(string attribute, Variant value) Added Event Instance.AttributeChanged(string attribute)

Attributes are pretty awesome. They’re effectively custom properties and allow you to store various Lua types inside of an Instance. The attributes are serialized into the instance so they can be saved and loaded later. It even supports arrays and dictionaries!

Supported Types string

bool

number

table

Axes

BrickColor

CFrame

Color3

ColorSequence

ColorSequenceKeypoint

EnumItem

Faces

NumberRange

NumberSequence

NumberSequenceKeypoint

PhysicalProperties

Ray

Rect

Region3

Region3int16

UDim

UDim2

Vector2

Vector2int16

Vector3

Vector3int16 (Also worth mentioning that int and float types are technically supported, but all Lua numbers in practice are doubles, so you can’t add them through Lua.)

There are a few catches of course. For example, instances and functions cannot be attributes; only the built-in types like numbers, booleans, Vector3, CFrame, etc, can be attributes. You also can’t attach tables that have functions or metatables connected to them. Its purely data oriented.

Serializing a table has the following requirements:

Arrays cannot have any holes in them.

If a table is a dictionary instead of an array, all of its keys must be strings.

Any values that are stored in the table have to be supported as attributes themselves.

As for Roblox’s CollectionService feature, attributes haven’t quite superseded tags yet. Tags can still be used to efficiently mass-query instances in the game, whereas attributes cannot be queried globally. Therefore tags and attributes serve different purposes from each other.

This feature hasn’t been rolled out just yet, but it should be available soon!

Shoutouts to @ComplexGeometry for implementing this feature!