In October or November, ROBLOX added a few functions to Instance which allows us to assign values to certain names. Basically, meta-programming
In the 7+ months that these functions have been added, they are yet to be implemented.
fdsAttributes - an alternative to attributes
You can get the module here
Documentation
This module was designed to be as similar as possible to the functions currently available for Instance, bar one function
Functions
void SetAttribute(Instance instance, string attribute, Variant value)
Assigns a new value to the specified attribute for the instanceVariant GetAttribute(Instance instance, string attribute)
Returns the value currently assigned to the attribute for that instance (can return nil)dictionary GetAllAttributes(Instance instance)
Returns all attributes assigned to that Instance as a dictionary, where the keys are the attribute's name and the value is the value assigned to that attributeEvents
RBXScriptSignal AttributeChanged(Instance instance, string attribute)
Fires whenever an attribute changes for the specified instanceIssues
Replication over the client/server boundary is not possible
This is an issue regarding how modules work, currently, it is not possible to truly replicate attributes over the client server boundary
With a bit of work, I managed to make a small fork to make it replicate
GetAttributeChangedSignal is not implemented
This is an intentional choice, use the AttributeChanged event insteadExample
local fdsAttributes = require(ServerStorage.fdsAttributes)
fdsAttributes:SetAttribute(workspace.Part, "TestValue", "hello world")
print(fdsAttributes:GetAttribute(workspace.Part, "TestValue")
--prints out 'hello world'
Feel free to report any bugs if they happen to occur