Humanoid.StateChanged:Connect(function(k,l)if isFirstPerson==true and IncludeJumpSway==true then if l==Enum.HumanoidStateType.Landed then local k=Instance.new("\067\070\114\097\109\101\086\097\108\117\101")k.Value=CFrame.new(0,0,0)*CFrame.Angles(math.rad(-0.75)*SwaySize,0,0)local l=TweenService:Create(k,TweenInfo.new(.18/Sensitivity,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{Value=CFrame.new(0,0,0)})l:Play()game.Debris:AddItem(l,2)l.Completed:Connect(function()k.Value=CFrame.new(0,0,0)*CFrame.Angles(math.rad(.225)*SwaySize,0,0)local l=TweenService:Create(k,TweenInfo.new(.72/Sensitivity,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Value=CFrame.new(0,0,0)})l:Play()game.Debris:AddItem(l,3)end)spawn(function()for l=1,60,1 do Camera.CFrame=Camera.CFrame*k.Value RunService.Heartbeat:Wait()end end)local E=TweenService:Create(JumpSwayGoal,TweenInfo.new(.15/Sensitivity,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),{Value=CFrame.new(0,0,0)*CFrame.Angles(-math.rad(5)*SwaySize,0,0)})E:Play()game.Debris:AddItem(E,2)E.Completed:Connect(function()local k=TweenService:Create(JumpSwayGoal,TweenInfo.new(.7/Sensitivity,Enum.EasingStyle.Quart,Enum.EasingDirection.Out),{Value=CFrame.new(0,0,0)})k:Play()game.Debris:AddItem(k,2)end)elseif l==Enum.HumanoidStateType.Freefall then local k=TweenService:Create(JumpSwayGoal,TweenInfo.new(.5/Sensitivity,Enum.EasingStyle.Sine),{Value=CFrame.new(0,0,0)*CFrame.Angles(math.rad(7.5)*SwaySize,0,0)})k:Play()game.Debris:AddItem(k,2)end end end)local k

Humanoid.StateChanged:Connect(function(oldstate, newstate)
	if isFirstPerson == true and IncludeJumpSway == true then -- dont apply camera/Viewmodel changes if we aren't in first person
		if newstate == Enum.HumanoidStateType.Landed then
			-- animate the camera's landing "thump"
			--
			-- tween a dummy cframe value for camera recoil
			local camedit = Instance.new("CFrameValue")
			camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(-0.75)*SwaySize,0,0)
			local landedrecoil = TweenService:Create(camedit, TweenInfo.new((0.03*6)/Sensitivity, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecoil:Play() ; game.Debris:AddItem(landedrecoil, 2)
			landedrecoil.Completed:Connect(function()
				camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0.225)*SwaySize,0,0)
				local landedrecovery = TweenService:Create(camedit, TweenInfo.new((0.03*24)/Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecovery:Play(); game.Debris:AddItem(landedrecovery, 3)
			end)
			-- apply the camera adjustments
			spawn(function()
				for i = 1,60 do
					Camera.CFrame = Camera.CFrame*camedit.Value
					RunService.Heartbeat:Wait()
				end
			end)
			-- animate the jump Sway to make the Viewmodel thump down on landing
			local viewmodelrecoil = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.15/Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)*CFrame.Angles(-math.rad(5)*SwaySize,0,0)}) ; viewmodelrecoil:Play(); game.Debris:AddItem(viewmodelrecoil, 2)
			viewmodelrecoil.Completed:Connect(function()
				local viewmodelrecovery = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.7/Sensitivity, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; viewmodelrecovery:Play() ; game.Debris:AddItem(viewmodelrecovery, 2)
			end)
		elseif newstate == Enum.HumanoidStateType.Freefall then
			-- animate jump Sway when the Character is falling or jumping
			local viewmodeljump = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.5/Sensitivity, Enum.EasingStyle.Sine), {Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(7.5)*SwaySize,0,0)}) ; viewmodeljump:Play() ; game.Debris:AddItem(viewmodeljump, 2)
		end	
	end
end)

local ArmCoroutine