ViewModel code not working at all?!

Hello every1!
I need help with my viewmodel.
I want it to disappear when tool is unequipped and appear when equipped.
But somehow, its not working, not even running.
I dunno why. Here is the code:

local camera = game.Workspace.CurrentCamera;
local humanoid = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid");
local repWeapon = game.ReplicatedStorage.GunViewModels:WaitForChild("AK-47");
local weapon = repWeapon:Clone();
local viewModel = game.ReplicatedStorage.GunViewModels:WaitForChild("viewModel"):Clone();
--
local equipped = false;
--
weapon.Parent = viewModel;
viewModel.Parent = camera;
print("Weapon parent viewmodel");
--
local joint = Instance.new("Motor6D");
joint.C0 = CFrame.new(1, -1.5, -2);
joint.Part0 = viewModel.Head;
joint.Part1 = weapon.Handle;
joint.Parent = viewModel.Head;
--
script.Parent.Equipped:Connect(function()
	
	
end)
local function startVIew()
	viewModel.Parent = camera;
end
--
local function breakView()
	viewModel.Parent = nil;
end
--
local function onDied()
	viewModel.Parent = nil;
end
local function updateArm(key)
	
	local shoulder = viewModel[key.."UpperArm"][key.."Shoulder"];
	

	local cf = weapon[key].CFrame * CFrame.Angles(math.pi/2, 0, 0) * CFrame.new(0, 1.5, 0);
	from before)
	shoulder.C1 = cf:inverse() * shoulder.Part0.CFrame * shoulder.C0;
end

local function onUpdate(dt)
	
		viewModel.Head.CFrame = camera.CFrame;
		viewModel.Head.CFrame = camera.CFrame;
	
		updateArm("Right");
		updateArm("Left");
	
end
--
local aimCount = 0;
local offset = weapon.Handle.CFrame:inverse() * weapon.Aim.CFrame;

local function aimDownSights(aiming)

		local start = joint.C1;
		local goal = aiming and joint.C0 * offset or CFrame.new();
	
		aimCount = aimCount + 1;
		local current = aimCount;
		for t = 0, 101, 10 do
			if (current ~= aimCount) then break; end
			game:GetService("RunService").RenderStepped:Wait();
			joint.C1 = start:Lerp(goal, t/100);
		end
	
end

local function onInputBegan(input, process)

	if (process) then return; end
		if (input.UserInputType == Enum.UserInputType.MouseButton2) then
			aimDownSights(true);
		
	end
end

local function onInputEnded(input, process)
	
		if (process) then return; end
		if (input.UserInputType == Enum.UserInputType.MouseButton2) then
			aimDownSights(false);
		end
	
end
--
script.Parent.Equipped:Connect(function()
	
	startVIew()
end)
script.Parent.Unequipped:Connect(function()
	breakView()
end)
--
humanoid.Died:Connect(onDied);
game:GetService("RunService").RenderStepped:Connect(onUpdate);
game:GetService("UserInputService").InputBegan:Connect(onInputBegan);
game:GetService("UserInputService").InputEnded:Connect(onInputEnded);
--

Explorer:
image