PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

GetAttributes

This function returns a dictionary of string → variant pairs for each attribute where the string is the name of the attribute and the variant is a non-nil value.

For example, the following code snippet will print an instance’s attributes and values. Note that this code sample does not define Instance:

local attributes = instance:GetAttributes()
for name, value in pairs(attributes) do
    print(name .. “ “ .. value)
end

See also

  • Instance/SetAttribute, sets the attribute with the given name to the given value
  • Instance/GetAttribute, returns the attribute which has been assigned to the given name
  • Instance/AttributeChanged, fires whenever an attribute is changed on the instance
  • Instance/GetAttributeChangedSignal, returns an event that fires when the given attribute changes

Returns

Return Type Summary

A dictionary of string → variant pairs for each attribute where the string is the name of the attribute and the variant is a non-nil value