Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is Instance:GetAttribute() used for?

I was check on the document. But there is nothing there.

So can someone explain what is Instance:GetAttribute() used for please?

1 answer

✓ Accepted answer

They're a bit like tags or properties. You can set the attribute (a string value) to a value you want for any instance using SetAttribute, for example, Instance:SetAttribute("example", 123). It's a key-value pair system.

It's sorta like assigning a custom property to an instance.

GetAttribute returns the value of the given string, and GetAttributes returns all the given key-value attributes assigned to the instance.

They talk about it a bit more on the developer forum update post.

https://devforum.roblox.com/t/release-notes-for-408/378664

1 comment

0

Thank for the explanation, it help me a lot. And I wonder when Roblox will update their documents?

This discussion is preserved as it was. New answers, comments, and votes are closed.