Get Attribute
Retrieve a specific attribute value from a Roblox instance. Attributes are custom data values that can be attached to any instance in Roblox Studio.Parameters
Roblox instance path using dot notation (e.g.,
"game.Workspace.Part", "game.ServerStorage.DataStore")Name of the attribute to retrieve
Response
Returns the attribute value. The return type depends on the attribute’s data type:- String attributes return
string - Number attributes return
number - Boolean attributes return
boolean - Vector3 attributes return
{X: number, Y: number, Z: number} - Color3 attributes return
{R: number, G: number, B: number} - Returns
nullif the attribute doesn’t exist
Supported Attribute Types
Roblox supports these attribute data types:- Primitives: string, number, boolean
- Vectors: Vector3, Vector2, UDim, UDim2
- Colors: Color3, BrickColor
- Special: NumberRange, Rect
Example Usage
Use Cases
Game Configuration
Store gameplay values like damage, health, speed multipliers, or cooldown timers on weapon/character instances.Level Design
Mark spawn points, checkpoints, or trigger zones with attributes for position offsets or activation states.Data Persistence
Read configuration attributes before saving player data or loading game state.AI-Driven Gameplay
Retrieve AI behavior parameters (aggression level, patrol radius) stored as attributes.Error Handling
- Throws error if
instancePathis invalid or instance doesn’t exist - Returns
nullif attribute doesn’t exist (this is not an error) - Throws error if instance doesn’t support attributes (rare edge case)
Related Tools
Set Attribute
Set or update an attribute value
Get Attributes
Get all attributes on an instance
Delete Attribute
Remove an attribute from an instance
Notes
- Attributes are replicated from server to client automatically
- Attribute changes fire
AttributeChangedsignal in Lua - Attributes are visible in Studio’s Properties panel under “Attributes” section
- Maximum attribute name length: 100 characters
- Attributes are saved with the game file (.rbxl/.rbxlx)