New Studio Beta: Attributes!

This is bloody mental! Goodbye intvalues you will not be missed!

I was just thinking about this feature and I saw the update this is a great update.

I’ve thought about using this for player data replication as well but I doubt it’ll be feasible until they add table support and a couple other things.

I’d check out ReplicaService by loleris in the meantime. Super powerful and easy to use and set up, and does exactly what you describe.

I use it for all my data replication these days

5 Likes

Yes! Finally, I’ve been waiting for so long for this!

it would be super cool if this function passed the new value when connected to the signal returned by :GetPropertyChangedSignal()

6 Likes

Can we get a tables ones as well. That’d help out a lot when working with stuff like this.

Wouldn’t this be the same for a child of an object?

1 Like

I might keep using values for a while. But these will come in help later on when I will stop using them for this.

No, this wouldn’t be too wonderful, especially in a big object with many descendants, do you prioritize them or the attributes? If you really want this, a metatable such as

setmetatable({Object}, {
   __index = function(self, key)
      return rawget(self, 1):GetAttribute(key) or rawget(self, 1)[key];
   end;
});
1 Like

Yeah, literally just change your attribute name just like you would change your objects name.

This is brilliant, I hope this goes live soon! I could really make use of this feature.

is there a planned release date?

Yes, that makes sense, I noticed that problem in my previous post. It’s mostly my style of programming that conflicts with this one. (I almost never use functions to retrieve values, because of my mindset).

As for your snippet, It’s a little confusing to me, as doing such would limit the use of other indexes with the particular object, (Unless you have two separate Variables). However, it was an interesting concept, so I took it and expanded on it.

local function CreateSpecialInstance(SpecialInstance)
    return setmetatable({}, {
        __index = function(Self, Index)
            if Index == "Attributes" then
                return SpecialInstance:GetAttributes()
            end
            return SpecialInstance:GetAttribute(Index) or SpecialInstance[Index];
        end;
        __newindex = function(Self, Index, Value)
            if SpecialInstance[Index] then
                SpecialInstance[Index] = Value
            else
                SpecialInstance:SetAttribute(Index, Value)
            end
        end;
    })
end

Thanks for the idea, this is making quite a lot more sense to me.

now, on a different subject:

No there is not a planned release date. It will be released when they have confirmed that it has a relatively low chance of breaking or otherwise ruining your game.

1 Like

This is cool but when I tested it, it didnt work. But I might have written the script wrong.

Now we can configure our scripts like in Unity!

I think tables are the most important than anything else because you can put all sorts of things in there (except like actual bricks)

for example; if we dont have CFrame but we have a table instead, we could just do {CFrame.new(…)}

Thank you for reiterating on my code, I was just providing a proof of concept, wasn’t sure what it would have done to metatable the single Instance and couldn’t test.

if Index == "Attributes" then
    return SpecialInstance:GetAttributes()
end

What would you use this for in production? It would be a lot more delicate in this case to just use the function. You don’t see tables having a built-in table.length in lua, so why would instances present such a trait?

Hm, quick question, if I have these enabled, will they work on Roblox Player as well?

No, anything that’s in Beta is studio only

I’ve always wanted something like this!! I didn’t think it’d ever happen, but little did I know that it was coming up for the past year…