local function U(U)local H=not U for U,X in ipairs(ArmPartsTable)do X.LocalTransparencyModifier=armTransparency X.CastShadow=H end end local function H(U)isFirstPerson=U Viewmodel.Parent=U and workspace.CurrentCamera or nil RightShoulderClone.Enabled=U LeftShoulderClone.Enabled=U LeftShoulder.Enabled=not U RightShoulder.Enabled=not U if U then RightShoulderClone.Part1=RightArm RightShoulderClone.Part0=FakeTorso RightShoulderClone.Parent=FakeTorso LeftShoulderClone.Part1=LeftArm LeftShoulderClone.Part0=FakeTorso LeftShoulderClone.Parent=FakeTorso end end

local function setArmVisibility(bool)
	local castshadow = not bool
	for i, part in ipairs(ArmPartsTable) do
		part.LocalTransparencyModifier = armTransparency
		part.CastShadow = castshadow
	end
end

local function toggleViewmodel(toggle)
	isFirstPerson = toggle --// Update the first person state
	Viewmodel.Parent = toggle and workspace.CurrentCamera or nil --// Put the Viewmodel in the camera, or take it out
	RightShoulderClone.Enabled = toggle --// Update joints
	LeftShoulderClone.Enabled = toggle
	LeftShoulder.Enabled = (not toggle) --// Update the original joints (to prevent :fling incidents)
	RightShoulder.Enabled = (not toggle)
	if toggle then
		RightShoulderClone.Part1 = RightArm
		RightShoulderClone.Part0 = FakeTorso
		RightShoulderClone.Parent = FakeTorso
		--// I'm not sure what the point of doing this here is. I'm too scared to change it though because this code is AWFUL.
		--// God knows what would happen.
		LeftShoulderClone.Part1 = LeftArm
		LeftShoulderClone.Part0 = FakeTorso
		LeftShoulderClone.Parent = FakeTorso
	end
end

