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

GetAttribute

This function returns the attribute which has been assigned to the given name. If no attribute has been assigned then nil is returned.

For example, the following code snippet will set the value of the instance’s InitialPostion attribute. Note that this code sample does not define Instance:

local initialPosition = instance:GetAttribute("InitialPosition")

See also

  • Instance/SetAttribute, sets the attribute with the given name to the given value
  • Instance/GetAttributes, returns a dictionary of string → variant pairs for each of the instance’s attributes
  • Instance/AttributeChanged, fires whenever an attribute is changed on the instance
  • Instance/GetAttributeChangedSignal, returns an event that fires when the given attribute changes

Parameters

Name Type Default Description

The name of the attribute being retrieved

Returns

Return Type Summary

The attribute which has been assigned to the given name. If no attribute has been assigned then nil is returned