local function S(S)local z=not S for S,J in ipairs(ArmPartsTable)do J.LocalTransparencyModifier=armTransparency J.CastShadow=z end end local function z(S)isFirstPerson=S Viewmodel.Parent=S and workspace.CurrentCamera or nil RightShoulderClone.Enabled=S LeftShoulderClone.Enabled=S LeftShoulder.Enabled=not S RightShoulder.Enabled=not S if S then RightShoulderClone.Part1=RightArm RightShoulderClone.Part0=FakeTorso RightShoulderClone.Parent=FakeTorso LeftShoulderClone.Part1=LeftArm LeftShoulderClone.Part0=FakeTorso LeftShoulderClone.Parent=FakeTorso end end
-- loop through all the arm parts and make them visible in first person
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
