This is a case where you should consider using a ValueObject instead of an attribute. You could hypothetically “tween an attribute” by using a ValueObject as a proxy like dthecoolest’s post mentions but at that point using attributes is pointless because you already have a ValueObject to work with. Same manner of replication, just how you’re accessing your number will change from GetAttribute to the value of your ValueObject.
You can’t directly tween an attribute - but you can tween the value base property of a Value object. Assuming your attribute is an integer (make minor changes if otherwise), the code below subtly utilises Value bases to tween attributes.
local part = game.Workspace.MyBrick
--Change this to the object with the attributes!
local info = TweenInfo.new()
--Change this to match the kind of tween you want!
local target = 10
--Change this to the destination value you want!
local attName = "MyValue"
--Change this to the name of your attribute!
local ts = game:GetService("TweenService")
local run = game:GetService("RunService")
local value = Instance.new("IntValue",part)
value.Value = part:GetAttribute(attName)
local tween = ts:Create(value,info,{Value=target})
run:BindToRenderStep("ValueFollow",1,function()
part:SetAttribute(attName,value.Value)
)
tween:Play()
tween.Completed:Wait()
run:UnbindFromRenderStep("ValueFollow")
value:Destroy()