Attributes Replication

Is it guaranteed that if I set attributes on server for a part that is not parented to workspace, then parent it to workspace, part will be replicated with attributes to clients atomically?

As long as the part itself replicates, the attributes will replicate granted they were set on the server.

So if the client can access the part, then yes, the attributes will replicate!

I understand that they will be replicated. The question was do they replicate together with a part meaning that if part was replicated it is guaranteed that attributes were already replicated also or they replicate async meaning that replication of attributes and replication of part are 2 different processes?

False.

You can do local testing.

Client:

local part = workspace:WaitForChild("Part")



part:GetAttributeChangedSignal("Hi"):Connect(function():()
	print(part:GetAttribute("Hi"))
end)

Server:

local ServerStorage = game:GetService("ServerStorage")

local part = workspace.Part


task.wait(5)

part:SetAttribute("Hi",true)


task.wait(1)
part.Parent=ServerStorage
task.wait(1)
part:SetAttribute("Hi","No lol")

Does not replicate.

Of course it is false in your case. ServerStorage is a container that is not accessible from client. As @FroDev1002 stated, client have to be able to access part

Once you parent it to ServerStorage it no longer replicates cause the client no longer has access to it and cant see its changes :sob:

thats what I meant

Ima try a little test to see, but Id assume if once the part replicates the attributes would replicate with it

no clue what I did but somehow I crashes roblox studio :skull:

With every test I’ve done, every time the part is loaded it seems to have its attributes, so pretty sure it happens all at once.

How would you test it? I don’t exactly understand

Well I first just used workspace.ChildAdded:Connect to tell when something is added, and then instantly get its attributes, of which the attributes were listed.

I know events can be a little delayed, so I then used RunService.HeartBeat to check every frame and print the attributes of the part, every time it printed the attributes.

So it would appear that the part itself and its attributes do replicate together at the same time, at least thats what it seems like!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.