if humanoid.RigType==Enum.HumanoidRigType.R15 then rigtype="\082\049\053"torso=character:WaitForChild("\085\112\112\101\114\084\111\114\115\111")lowertorso=character:WaitForChild("\076\111\119\101\114\084\111\114\115\111")larm=character:WaitForChild("\076\101\102\116\085\112\112\101\114\065\114\109")rarm=character:WaitForChild("\082\105\103\104\116\085\112\112\101\114\065\114\109")waist=torso:WaitForChild("\087\097\105\115\116")oldc0=waist.C0 leftshoulder=(character:WaitForChild("\076\101\102\116\085\112\112\101\114\065\114\109")):WaitForChild("\076\101\102\116\083\104\111\117\108\100\101\114")rightshoulder=(character:WaitForChild("\082\105\103\104\116\085\112\112\101\114\065\114\109")):WaitForChild("\082\105\103\104\116\083\104\111\117\108\100\101\114")fakelowertorso=Instance.new("\080\097\114\116")fakelowertorso.Name="\076\111\119\101\114\084\111\114\115\111"fakelowertorso.CanCollide=false fakelowertorso.Anchored=false fakelowertorso.CanTouch=false fakelowertorso.Transparency=1 fakelowertorso.Parent=viewmodel faketorso.Size=torso.Size fakeroot.Size=rootpart.Size fakelowertorso.Size=lowertorso.Size faketorso.CFrame=fakeroot.CFrame roothipclone=(lowertorso:WaitForChild("\082\111\111\116")):Clone()roothipclone.Parent=fakelowertorso roothipclone.Part0=fakeroot roothipclone.Part1=fakelowertorso if firstperson_waist_movements_enabled then waistclone=(torso:WaitForChild("\087\097\105\115\116")):Clone()waistclone.Parent=faketorso waistclone.Part0=fakelowertorso waistclone.Part1=faketorso else waistclone=Instance.new("\087\101\108\100")waistclone.Parent=faketorso waistclone.Part0=fakelowertorso waistclone.Part1=faketorso waistclone.C0=waist.C0 waistclone.C1=waist.C1 end leftshoulderclone=leftshoulder:Clone()leftshoulderclone.Name="\076\101\102\116\083\104\111\117\108\100\101\114\067\108\111\110\101"leftshoulderclone.Parent=faketorso leftshoulderclone.Part0=larm rightshoulderclone=rightshoulder:Clone()rightshoulderclone.Name="\082\105\103\104\116\083\104\111\117\108\100\101\114\067\108\111\110\101"rightshoulderclone.Parent=faketorso rightshoulderclone.Part0=rarm table.insert(armparts,character:WaitForChild("\082\105\103\104\116\076\111\119\101\114\065\114\109"))table.insert(armparts,character:WaitForChild("\076\101\102\116\085\112\112\101\114\065\114\109"))table.insert(armparts,character:WaitForChild("\082\105\103\104\116\085\112\112\101\114\065\114\109"))table.insert(armparts,character:WaitForChild("\076\101\102\116\076\111\119\101\114\065\114\109"))table.insert(armparts,character:WaitForChild("\082\105\103\104\116\076\111\119\101\114\065\114\109"))table.insert(armparts,character:WaitForChild("\076\101\102\116\072\097\110\100"))table.insert(armparts,character:WaitForChild("\082\105\103\104\116\072\097\110\100"))else rigtype="\082\054"torso=character:WaitForChild("\084\111\114\115\111")table.insert(armparts,character:WaitForChild("\082\105\103\104\116 \065\114\109"))table.insert(armparts,character:WaitForChild("\076\101\102\116 \065\114\109"))roothip=rootpart:FindFirstChildOfClass("\077\111\116\111\114\054\068")oldc0=roothip.C0 leftshoulder=torso:WaitForChild("\076\101\102\116 \083\104\111\117\108\100\101\114")rightshoulder=torso:WaitForChild("\082\105\103\104\116 \083\104\111\117\108\100\101\114")faketorso.Size=torso.Size fakeroot.Size=rootpart.Size faketorso.CFrame=fakeroot.CFrame roothipclone=roothip:Clone()roothipclone.Parent=fakeroot roothipclone.Part0=fakeroot roothipclone.Part1=faketorso leftshoulderclone=leftshoulder:Clone()leftshoulderclone.Name="\076\101\102\116\083\104\111\117\108\100\101\114\067\108\111\110\101"leftshoulderclone.Parent=torso leftshoulderclone.Part0=torso rightshoulderclone=rightshoulder:Clone()rightshoulderclone.Name="\082\105\103\104\116\083\104\111\117\108\100\101\114\067\108\111\110\101"rightshoulderclone.Parent=torso rightshoulderclone.Part0=torso larm=character:WaitForChild("\076\101\102\116 \065\114\109")rarm=character:WaitForChild("\082\105\103\104\116 \065\114\109")end if firstperson_arm_transparency>=1 then armsvisible=false end
-- setup based on rig type (r15 or r6)
if humanoid.RigType == Enum.HumanoidRigType.R15 then
	rigtype = "R15"
	torso = character:WaitForChild("UpperTorso")
	lowertorso = character:WaitForChild("LowerTorso")
	larm = character:WaitForChild("LeftUpperArm")
	rarm = character:WaitForChild("RightUpperArm")
	-- setup variables
	waist = torso:WaitForChild("Waist")
	oldc0 = waist.C0
	leftshoulder = character:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder")
	rightshoulder = character:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder")
	-- make fake lower torso
	fakelowertorso = Instance.new("Part")
	fakelowertorso.Name = "LowerTorso"
	fakelowertorso.CanCollide = false
	fakelowertorso.Anchored = false
	fakelowertorso.CanTouch = false
	fakelowertorso.Transparency = 1
	--fakelowertorso.Massless = true
	fakelowertorso.Parent = viewmodel
	--
	faketorso.Size = torso.Size
	fakeroot.Size = rootpart.Size
	fakelowertorso.Size = lowertorso.Size
	faketorso.CFrame = fakeroot.CFrame
	roothipclone = lowertorso:WaitForChild("Root"):Clone()
	roothipclone.Parent = fakelowertorso
	roothipclone.Part0 = fakeroot
	roothipclone.Part1 = fakelowertorso
	--
	if firstperson_waist_movements_enabled then
		waistclone = torso:WaitForChild("Waist"):Clone()
		waistclone.Parent = faketorso
		waistclone.Part0 = fakelowertorso
		waistclone.Part1 = faketorso
	else
		-- waist movements not enabled, replace waist joint with a weld
		waistclone = Instance.new("Weld")
		waistclone.Parent = faketorso
		waistclone.Part0 = fakelowertorso
		waistclone.Part1 = faketorso
		waistclone.C0 = waist.C0
		waistclone.C1 = waist.C1
	end
	--
	leftshoulderclone = leftshoulder:Clone()
	leftshoulderclone.Name = "LeftShoulderClone"
	leftshoulderclone.Parent = faketorso
	leftshoulderclone.Part0 = larm
	--
	rightshoulderclone = rightshoulder:Clone()
	rightshoulderclone.Name = "RightShoulderClone"
	rightshoulderclone.Parent = faketorso
	rightshoulderclone.Part0 = rarm
	-- add the arms
	table.insert(armparts, character:WaitForChild("RightLowerArm"))
	table.insert(armparts, character:WaitForChild("LeftUpperArm"))
	table.insert(armparts, character:WaitForChild("RightUpperArm"))
	table.insert(armparts, character:WaitForChild("LeftLowerArm"))
	table.insert(armparts, character:WaitForChild("RightLowerArm"))
	table.insert(armparts, character:WaitForChild("LeftHand"))
	table.insert(armparts, character:WaitForChild("RightHand"))
else
	rigtype = "R6"
	torso = character:WaitForChild("Torso")
	-- add the arms
	table.insert(armparts, character:WaitForChild("Right Arm"))
	table.insert(armparts, character:WaitForChild("Left Arm"))
	-- setup variables
	roothip = rootpart:FindFirstChildOfClass("Motor6D")
	oldc0 = roothip.C0
	leftshoulder = torso:WaitForChild("Left Shoulder")
	rightshoulder = torso:WaitForChild("Right Shoulder")
	--
	faketorso.Size = torso.Size
	fakeroot.Size = rootpart.Size
	faketorso.CFrame = fakeroot.CFrame
	roothipclone = roothip:Clone()
	roothipclone.Parent = fakeroot
	roothipclone.Part0 = fakeroot
	roothipclone.Part1 = faketorso
	--
	leftshoulderclone = leftshoulder:Clone()
	leftshoulderclone.Name = "LeftShoulderClone"
	leftshoulderclone.Parent = torso
	leftshoulderclone.Part0 = torso
	--
	rightshoulderclone = rightshoulder:Clone()
	rightshoulderclone.Name = "RightShoulderClone"
	rightshoulderclone.Parent = torso
	rightshoulderclone.Part0 = torso
	--
	larm = character:WaitForChild("Left Arm")
	rarm = character:WaitForChild("Right Arm")
end

if firstperson_arm_transparency >= 1 then
	armsvisible = false
end
