Do attributes replicate same way properties do?

Let’s say on server I spawn a part like so:

local part = Instance.new("Part")
part.Color = Color3.new(0.5, 1, 1)
part.Name = "SomePart"
part.Anchored = true
part.Parent = workspace

the instant the client sees that part, all of its properties will be as expected, is that also true with attributes?

For example, i’ll make a part and give it an attribute:

--[ Server ]--
local part = Instance.new("Part")
part:SetAttribute("Attribute", true)
part.Name = "SomePart"
part.Parent = workspace

then on the client I’ll listen for when the part gets added:

--[ Client ]--
workspace.ChildAdded:Connect(function(child) 
    -- assuming child is SomePart
    print(child:GetAttribute("Attribute")) -- Will this ALWAYS print true?
end)

So will the attribute always be there when the instance exists, or do I have to wait for it just in case?

Yes it does, as long as the part isn’t added to the workspace before the client initializes the ChildAdded connection. I’d also advise you to take a look at the ROBLOX documentation for attributes:

https://create.roblox.com/docs/studio/instance-attributes

1 Like

Thanks, I just needed to make sure that’s what happens, from what I read, the docs dont say anything about that.