I believe the code inside the changed event runs after the position change is replicated. But I don’t want the position to change on the client at all, only on the server.
Answer
There is no way to change an instance property on the server without it replicating to the client, but you can change the instance property on the client without it replicating back to the server.
There is a part called “Part1” with the Position Vector3.new(0, 0, 0).
On the client you set Part1.Position to Vector3.new(10, 5, 2).
The server will see Part1.Position as Vector3.new(0, 0, 0).
IN ROBLOX STUDIO
How do I prevent client from automatically updating an instance property?
I have a variable that I want to set on the server, but the client overwrites it. Is there any way to prevent this?
I also tried setting the variable to nil, but the client still overwrites it.
If you want to set a variable on the server that is not replicated to the client, you can make a remote function on the server that calls a client function. local myVariable = 0
game:GetService(“ReplicatedStorage”):WaitForChild(“MyRemoteFunction”):OnServerEvent:Connect(function(player, value)
myVariable = value
player:FindFirstChild(“PlayerScripts”):WaitForChild(“MyClientFunction”):Invoke(value)
end)