-- turn off the viewmodel system

local function disableviewmodel()
	isfirstperson = false
	viewmodel.Parent = nil
	if rigtype == "R15" then
		-- disable viewmodel joints, enable real character joints
		rightshoulderclone.Enabled = false
		leftshoulderclone.Enabled = false
		viewmodel.Parent = nil
		-- reset shoulder joints to normal
		leftshoulder.Parent = larm
		leftshoulder.Part0 = torso
		leftshoulder.Part1 = larm
		rightshoulder.Parent = rarm
		rightshoulder.Part0 = torso
		rightshoulder.Part1 = rarm
		--
		leftshoulder.Enabled = true
		rightshoulder.Enabled = true
		--
		armtransparency = 0
		visiblearms(false)
	else
		rightshoulderclone.Enabled = false
		leftshoulderclone.Enabled = false
		viewmodel.Parent = nil
		-- reset shoulder joints to normal, anchor the arms
		leftshoulder.Parent = torso
		leftshoulder.Part0 = torso
		leftshoulder.Part1 = larm
		rightshoulder.Parent = torso
		rightshoulder.Part0 = torso
		rightshoulder.Part1 = rarm
		--
		leftshoulder.Enabled = true
		rightshoulder.Enabled = true
		--
		armtransparency = 0
		visiblearms(false)
	end
end
