Piston Tank Problem

Hello. I’m trying to add a ‘piston mode’ to a tank by using an animation but I was wondering if there was an alternative to the animation OR a property of the AnimationTrack

Proof(Video):
Screen capture - 55b02e72358238ba2ce7d3289d5b8c04 - Gyazo

Proof #2(Script):

local PistonTank = game.Workspace.PistonTank
local Humanoid = PistonTank.Humanoid
local Anim = Humanoid:LoadAnimation(PistonTank.Animation)
local Anim2 = Humanoid:LoadAnimation(PistonTank.PistonAnim)

while true do
	for i = 1,50 do
		PistonTank:SetPrimaryPartCFrame(PistonTank:GetPrimaryPartCFrame() * CFrame.new(0,0,1))
		wait(0.001)
	end
	wait(1)
	Anim:Play()
	wait(3)
	for i = 1,50 do
		PistonTank:SetPrimaryPartCFrame(PistonTank:GetPrimaryPartCFrame() * CFrame.new(0,0,-1))
		wait(0.001)
	end
	wait(1)
	Anim2:Play()
	wait(3)
end

It sounds a bit bizarre to have something like this but please help me on what I got wrong.