GetAttribute
Reads/writes instance attributes.
Syntax
:GetAttribute(name: string) -> any
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name used for the lookup or new object. |
Returns
| Type | Description |
|---|---|
any | Value / table |
Description
GetAttribute is part of the Instances library. Instances are live proxies backed by game memory. Property reads and method calls go through Roblox's own objects.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
The aliases :SetAttribute(name, value), :GetAttributes() resolve to the same implementation.
Example
workspace:SetAttribute("Mode", "test")
print(workspace:GetAttribute("Mode"))
for name, value in pairs(workspace:GetAttributes()) do
print(name, value)
end
Notes
- Aliases:
:SetAttribute(name, value),:GetAttributes(). - Instance proxies are backed by live game memory.