So, there’s different things to store different things, there’s IntValues
to store Values
etc., but we know there’s also Attributes
, but my question is, when should they be used?
I use Attributes in GUI frames and a GetAttributeChangedSignal to connect fancy open/close animations, and its easy to set from other scripts- saves time Imo
Attributes are a better version of Values.
New Studio Beta: Attributes! - Updates / Announcements - DevForum | Roblox
In the post they had when releasing attributes they addressed that attributes are faster, and take less memory. If you’re new to scripting then using regular values is fine, but when you start getting more advanced probably better to switch over to attributes. Unless of course you don’t care about performance then it doesn’t really matter.
Okay, I also have a question, most people for leaderstats use IntValues
, this means it’s better to use Attributes
?
Whenever I deal with stat systems I’m typically using json and saving to a website. I don’t use values at all, but I mean in theory it would probably be better. I don’t have an exact answer as I’ve never used it or tried it. I mean I wouldn’t be too concerned over performance as like if you’re only using it for leaderstats then the performance change would be extremely small if anything. You wouldn’t even notice it most likely. I would say just for now stick with it, if your game starts having heavy performance issues you can always switch over.
Thanks! Now I understand why Attributes exist
I’m pretty sure performance wise it would barely make a difference, its fine to stick with int values. Fyi attributes are faster to create and delete and has other advantages which is why it is often in favor over values