Is there a way to detect when a new attribute is added to an object using the SetAttribute()
method?
I want to track all attributes on an object, including any new ones added dynamically. Does Roblox provide an event or mechanism to achieve this?
Is there a way to detect when a new attribute is added to an object using the SetAttribute()
method?
I want to track all attributes on an object, including any new ones added dynamically. Does Roblox provide an event or mechanism to achieve this?
Use AttributeChanged
, keep in mind that this will also detect when an attributes value changes.
Thats exactly what I want [checking for both]. How would I write it?
I ran this as a test so just replace workspace with your instance.
workspace.AttributeChanged:Once(function(attr) print(attr) end)
workspace:SetAttribute("test", 3)
instance.AttributeChanged:Connect(function(attrName)
print(attrName.." added or changed.")
end)
Thanks Friend. It works we6terll.fefwefwefwe