Confusion on Server to Client Replication

My understanding is that server changes replicate to all clients. However, I am confused about the following scenario.

  1. Server fires a remote event to a client.
  2. Client sets the transparency of part to 1 from 0.
  3. Server sets the transparency of part to 0.
  4. Transparency of part to still set to 1 on the client.

I have a few ideas as to why this is occurring.

  1. From the server’s perspective, the transparency of part is already set to 0, so the server does not bother trying to replicate the property to the client because there is no change.
  2. When a change is made to an instance locally, it is locked, making it immune to server changes. (this seems unlikely, although not sure)
1 Like

This is why it’s happening, to the server there is no change to the property, so it is redundant to replicate it. Something you could try is:

1- On the server, add a part to the workspace; transparency 0.5
2- On the client set transparency 0
3- On the server set transparency to 0.25
4- Observe that on the client, the transparency is now 0.25

Server:

task.wait(5)

local p = Instance.new('Part')
p.Transparency = 0.5
p.Parent = workspace

task.wait(5)

p.Transparency = 0.25

Client:

workspace.ChildAdded:Connect(function(p)
	if p.Name == 'Part' and p:IsA('BasePart') then
		print('Part added to workspace, transparency:', p.Transparency)
		
		task.wait(2)
		
		print('Set part transparency to 0')
		
		p.Transparency = 0
		
		task.wait(5) -- wait for the server to change transparency
		
		print('Part transparency is now', p.Transparency)
	end
end)

Output:

  21:26:09.089  Part added to workspace, transparency: 0.5  -  Client - LocalScript:3
  21:26:11.093  Set part transparency to 0  -  Client - LocalScript:7
  21:26:16.096  Part transparency is now 0.25  -  Client - LocalScript:13

Thank you for the confirmation.

1 Like

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