Tweened Part Movement Not Replicating From Server To Client

I’m making a subway train for a game and want sliding doors that open when the player gets near them. So I made some and they worked for the outside doors, but the inside door to the drive cab is not opening on the client side. It works on the server but the tweeting doesn’t happen for any of the clients.

Video:

Here is my script:

Hello! So firstly, we should not see any tweens on the server side, those should be handled entirely by the client (ideally).

You don’t have to move the door on the server, just make it non collideable. Also, would you be able to upload your script as a text version instead of a screenshot? It would help me provide a solution more computationally instead of just talking :laughing:

Also, here is a script taken directly out of my game for a door.


local door = script.Parent
local sensor = door.ScanBox
local doorCoolDown = 8
local countDown = 0

--when sensor touched, open door for 10 seconds or something
sensor.Touched:Connect(function()
	
	if tick() - countDown > doorCoolDown then
		
		countDown = tick()
		print("open door")
		
		animateMachine:FireAllClients(door)
		
		door.Outline.CanCollide = false
		door.Brace.CanCollide = false
		
		task.wait(doorCoolDown)
		
		door.Outline.CanCollide = true
		door.Brace.CanCollide = true
	end
end)

oh yeah also here is what I put on the client side

local goal = {}

		goal.CFrame = machine.Outline.CFrame*CFrame.new(0, -10, 0)

		local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)

		local tween = game:GetService("TweenService"):Create(machine.Outline, tweenInfo, goal)

		tween:play()
		
		task.wait(8)
		
		local goal = {}

		goal.CFrame = machine.Outline.CFrame*CFrame.new(0, 10, 0)

		local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear)

		local tween = game:GetService("TweenService"):Create(machine.Outline, tweenInfo, goal)

		tween:play()

oh so you tween on client but only change the collision on the server

the only thing is in the video I have a door that uses the same exact script and works fine

----- Misc Varibles -----

local TweenService = game:GetService("TweenService")

local OpenTime = 1.5

local Info = TweenInfo.new(OpenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut,0,false)

local Timer = script.Parent.Parent.Timer

local Sensor = script.Parent

local safty = script.Parent.Parent.CanOpen

----- Door Varibles -----

local Door = script.Parent.Parent.Door

local Pos = Door.Position

local Open = TweenService:Create(Door, Info, {Position = Vector3.new(Pos.X - 4.3, Pos.Y, Pos.Z)})

local Close = TweenService:Create(Door, Info, {Position = Vector3.new(Pos.X, Pos.Y, Pos.Z)})


----- Functions -----

local function CheckForHuman(hit)
	
	if hit.Parent.Parent:FindFirstChild("Humanoid") then
		
		return true
		
	end
	
	if hit.Parent:FindFirstChild("Humanoid") then
		
		return true
		
	end
	
end


----- Logic -----

Sensor.Touched:Connect(function(HIT)
	
	if CheckForHuman(HIT) == true and safty.Value == true then	
		
		Sensor.CanTouch = false

		Open:Play()
		
		wait(OpenTime)
		
		Sensor.CanTouch = true
		
		Timer.Value = 2
		
	end
	
end)

Timer.Changed:Connect(function()
	
	if Timer.Value == 0 then
		
		Close:Play()
		
	end
	
end)