function Stand(I)local q=Torso["\076\101\102\116 \072\105\112"]local H=Torso["\082\105\103\104\116 \072\105\112"]local B=HRP.RootJoint Stance=2 if not I then spawn(function()local I=Humanoid.CameraOffset local q=B.C0.p for H=0,90,6.0 do local A=Sine(H)Humanoid.CameraOffset=I:lerp(StanceOffset[1],A)B.C0=CF(q:lerp(VEC3(),A))*CFANG(RAD(-90),0,RAD(180))RS:wait()end end)TweenJoint(ABWeld,CF(),CF(),Sine,.25)TweenJoint(q,CF(-1,-1,0)*CFANG(0,RAD(-90),0),CF(-0.5,1,0)*CFANG(0,RAD(-90),0),Sine,.25)TweenJoint(H,CF(1,-1,0)*CFANG(RAD(-180),RAD(90),0),CF(.5,1,0)*CFANG(RAD(-180),RAD(90),0),Sine,.25)elseif I then Humanoid.CameraOffset=StanceOffset[1]ABWeld.C0=CF()ABWeld.C1=CF()q.C0=CF(-1,-1,0)*CFANG(0,RAD(-90),0)q.C1=CF(-0.5,1,0)*CFANG(0,RAD(-90),0)H.C0=CF(1,-1,0)*CFANG(RAD(-180),RAD(90),0)H.C1=CF(.5,1,0)*CFANG(RAD(-180),RAD(90),0)B.C0=CFANG(RAD(-90),0,RAD(180))end end function Crouch()local I=Torso["\076\101\102\116 \072\105\112"]local q=Torso["\082\105\103\104\116 \072\105\112"]local H=HRP.RootJoint Stance=1 spawn(function()local I=Humanoid.CameraOffset local q=H.C0.p for B=0,90,6.0 do if Stance~=1 then break end local A=Sine(B)Humanoid.CameraOffset=I:lerp(StanceOffset[2],A)H.C0=CF(q:lerp(VEC3(0,-1,0),A))*CFANG(RAD(-90),0,RAD(180))RS:wait()end end)TweenJoint(ABWeld,CF(0,0,-0.0625),CF(),Sine,.25)TweenJoint(I,CF(-1,-0.5,0)*CFANG(0,RAD(-90),0),CF(-0.5,.5,1)*CFANG(0,RAD(-90),RAD(-90)),Sine,.25)TweenJoint(q,CF(1,-0.5,.25)*CFANG(RAD(-180),RAD(90),0),CF(.5,.5,1)*CFANG(RAD(-180),RAD(90),0),Sine,.25)end
--------------------[ STANCE FUNCTIONS ]----------------------------------------------

function Stand(OnDeselected)
	local LHip = Torso["Left Hip"]
	local RHip = Torso["Right Hip"]
	local Root = HRP.RootJoint
	Stance = 2
	if not OnDeselected then
		spawn(function()
			local PreviousOffset = Humanoid.CameraOffset
			local PreviousRootP = Root.C0.p
			for X = 0, 90, 1.5 / 0.25 do
				local Alpha = Sine(X)
				Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[1], Alpha)
				Root.C0 = CF(PreviousRootP:lerp(VEC3(), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
				RS:wait()
			end
		end)
		TweenJoint(ABWeld, CF(), CF(), Sine, 0.25)
		TweenJoint(LHip, CF(-1, -1, 0) * CFANG(0, RAD(-90), 0), CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0), Sine, 0.25)
		TweenJoint(
			RHip,
			CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0),
			CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0),
			Sine,
			0.25
		)
	elseif OnDeselected then
		Humanoid.CameraOffset = StanceOffset[1]
		ABWeld.C0 = CF()
		ABWeld.C1 = CF()
		LHip.C0 = CF(-1, -1, 0) * CFANG(0, RAD(-90), 0)
		LHip.C1 = CF(-0.5, 1, 0) * CFANG(0, RAD(-90), 0)
		RHip.C0 = CF(1, -1, 0) * CFANG(RAD(-180), RAD(90), 0)
		RHip.C1 = CF(0.5, 1, 0) * CFANG(RAD(-180), RAD(90), 0)
		Root.C0 = CFANG(RAD(-90), 0, RAD(180))
	end
end

function Crouch()
	local LHip = Torso["Left Hip"]
	local RHip = Torso["Right Hip"]
	local Root = HRP.RootJoint
	Stance = 1
	spawn(function()
		local PreviousOffset = Humanoid.CameraOffset
		local PreviousRootP = Root.C0.p
		for X = 0, 90, 1.5 / 0.25 do
			if Stance ~= 1 then
				break
			end
			local Alpha = Sine(X)
			Humanoid.CameraOffset = PreviousOffset:lerp(StanceOffset[2], Alpha)
			Root.C0 = CF(PreviousRootP:lerp(VEC3(0, -1, 0), Alpha)) * CFANG(RAD(-90), 0, RAD(180))
			RS:wait()
		end
	end)
	TweenJoint(ABWeld, CF(0, 0, -1 / 16), CF(), Sine, 0.25)
	TweenJoint(
		LHip,
		CF(-1, -0.5, 0) * CFANG(0, RAD(-90), 0),
		CF(-0.5, 0.5, 1) * CFANG(0, RAD(-90), RAD(-90)),
		Sine,
		0.25
	)
	TweenJoint(
		RHip,
		CF(1, -0.5, 0.25) * CFANG(RAD(-180), RAD(90), 0),
		CF(0.5, 0.5, 1) * CFANG(RAD(-180), RAD(90), 0),
		Sine,
		0.25
	)
end
