This document describes the format for serialized attributes in Roblox.
This section describes the first version of the format. Currently, there is only
one version. No bytes are reserved for indicating the version.
This version encodes the Instance.AttributesSerialize property. Because no
version indicator is included in the format itself, it is assumed that separate
versions of the format will be encoded in separate properties.
The following types are defined for the purposes of this specification.
| Type |
Description |
uint:N |
An unsigned integer of length N bits. |
int:N |
A signed integer of length N bits. |
float:N |
An IEEE 754 floating-point number of length N bits. |
[N]Type |
An array of constant length N, each entry of type Type. |
[Size]Type |
An array of length determined by the value of field Size, each entry of type Type. |
All values are little-endian.
Attributes are encoded as a Dictionary that maps attribute names
to values.
Several limitations may be applied to the Key field of an Entry in this
Dictionary:
- Must not have a length greater than 100 bytes.
- May only contain alphanumeric bytes and underscores. (
^[0-9A-Za-z_]*$)
- Must not begin with
RBX, which is reserved for Roblox.
The value of the Type field determines how the value of the Value field is
decoded.
- Size: 4+N bytes
- Numeric type: 0x02 (2)
- Decoded type: string (string)
| Field |
Offset |
Size |
Type |
| Size |
0 |
4 |
uint:32 |
| Value |
4 |
N |
[Size]uint:8 |
The Value field determines the bytes of the string.
- Size: 1 byte
- Numeric type: 0x03 (3)
- Decoded type: bool (boolean)
A value of of 0 is decoded to false, while any other value is decoded to
true.
false is encoded to 0, and true is encoded to 1.
- Size: 4 bytes
- Numeric type: 0x05 (5)
- Decoded type: float (number)
- Size: 8 bytes
- Numeric type: 0x06 (6)
- Decoded type: double (number)
| Field |
Offset |
Size |
Type |
| Size |
0 |
4 |
uint:32 |
| Value |
4 |
N |
[Size]Entry |
When decoding, entries with a duplicate Key are discarded.
- Size: 8 bytes
- Numeric type: 0x09 (9)
- Decoded type: UDim (userdata)
| Field |
Offset |
Size |
Type |
| Scale |
0 |
4 |
float:32 |
| Offset |
4 |
4 |
int:32 |
- Size: 16 bytes
- Numeric type: 0x0A (10)
- Decoded type: UDim2 (userdata)
| Field |
Offset |
Size |
Type |
| X |
0 |
8 |
UDim |
| Y |
8 |
16 |
UDim |
- Size: 4 bytes
- Numeric type: 0x0E (14)
- Decoded type: BrickColor (userdata)
The value corresponds to the Number field of the BrickColor value. Unknown
values are interpreted as the default BrickColor.
- Size: 12 bytes
- Numeric type: 0x0F (15)
- Decoded type: Color3 (userdata)
| Field |
Offset |
Size |
Type |
| R |
0 |
4 |
float:32 |
| G |
4 |
4 |
float:32 |
| B |
8 |
4 |
float:32 |
- Size: 8 bytes
- Numeric type: 0x10 (16)
- Decoded type: Vector2 (userdata)
| Field |
Offset |
Size |
Type |
| X |
0 |
4 |
float:32 |
| Y |
4 |
4 |
float:32 |
- Size: 12 bytes
- Numeric type: 0x11 (17)
- Decoded type: Vector3 (userdata)
| Field |
Offset |
Size |
Type |
| X |
0 |
4 |
float:32 |
| Y |
4 |
4 |
float:32 |
| Z |
8 |
4 |
float:32 |
- Size: 4+12*N bytes
- Numeric type: 0x17 (23)
- Decoded type: NumberSequence (userdata)
| Field |
Offset |
Size |
Type |
| Size |
0 |
4 |
uint:32 |
| Values |
4 |
12*N |
[Size]NumberSequenceKeypoint |
| Field |
Offset |
Size |
Type |
| Envelope |
0 |
4 |
float:32 |
| Time |
4 |
4 |
float:32 |
| Value |
8 |
4 |
float:32 |
- Size: 4+20*N bytes
- Numeric type: 0x19 (25)
- Decoded type: ColorSequence (userdata)
| Field |
Offset |
Size |
Type |
| Size |
0 |
4 |
uint:32 |
| Values |
4 |
20*N |
[Size]ColorSequenceKeypoint |
| Field |
Offset |
Size |
Type |
| Envelope |
0 |
4 |
float:32 |
| Time |
4 |
4 |
float:32 |
| Value |
8 |
12 |
Color3 |
- Size: 8 bytes
- Numeric type: 0x1B (27)
- Decoded type: NumberRange (userdata)
| Field |
Offset |
Size |
Type |
| Min |
0 |
4 |
float:32 |
| Max |
4 |
4 |
float:32 |
- Size: 16 bytes
- Numeric type: 0x1C (28)
- Decoded type: Rect (userdata)