How to individually position a pet based on the amount of pets there is

Hello everybody,

I am making a script where if a player clicks on a bag or chest then the pet will position itself and attack the bag. The issue is that if there is more than 1 pet. The pets all go in the same position and I was wondering if there was a way to position the pets differently.
Screenshot 2022-08-01 143700
For Example, if I have 5 pets and I want to position each pet in the specified position above how would I do that? So far I have a value that takes count of the number of pets equipped.
This is what I have so far

local CD = script.Parent -- click detector 
local Hitbox = script.Parent.Parent


local function DetectClick(playerWhoClicked)
	-- CD function
	local amountequuippedvalue = plr.PlayerGui.Inventory.LowerInvFrame.AmountEquipped.AmountEquippedValue-- value used to track the specified amount of pets equipped
	local character = playerWhoClicked.Character:GetChildren() or playerWhoClicked.CharacterAdded:Wait():GetChildren()-- getting char
	for _,pet in pairs(character) do
	if pet ~= nil then 
			if pet:IsA("Model")  then
				-- if can a print, it will print the pet name ex:Dragon 
				print("Pet Found")
				local alignPosition = pet:WaitForChild("AlignPosition")
				local alignOrientation = pet:WaitForChild("AlignOrientation")
				local attachmentpet = pet.PetHitBox:WaitForChild("Attachment")
				local atttachmentTarget = Hitbox.Attachment
				-- all these attachments and constrainst were created before hand
				attachmentpet.Parent = pet.PrimaryPart
				alignPosition.Attachment0 = attachmentpet
				alignPosition.Attachment1 = atttachmentTarget
				alignPosition.Parent = Hitbox
			-- for positioning the pet 
				alignOrientation.Attachment0 = attachmentpet
				alignOrientation.Attachment1 = atttachmentTarget
					alignOrientation.Parent = Hitbox
					-- for rotating the pet
					if amountequuippedvalue.Value == 1 then 
						atttachmentTarget.Position =,0,4) 

					elseif amountequuippedvalue.Value == 2 then 
						atttachmentTarget.Position =,0,0) 
						atttachmentTarget.Orientation =,87,0)

					elseif amountequuippedvalue.Value == 3 then 
						atttachmentTarget.Orientation =,185,0)
						atttachmentTarget.Position =,0,-4)

					elseif amountequuippedvalue.Value == 4 then 

						atttachmentTarget.Position =,0,0)
						atttachmentTarget.Orientation =,-90,0)
	                  elseif amountequuippedvalue.Value == 5 then 

						atttachmentTarget.Position =,0,3)
				print("There was a issue with the pet loading")

Note: I am not exactly asking for script(would be appreciated tho) just for something that can help me like an article.

Make it so it faces the bag, then make it walk forward until it reaches the bag. Tho idk if this would work well

yea ik i did that but I need help doing that with multiple pets, all positioned at different positions and orientations, and heights (cause flying and land pets)