i was trying to make a pet system with the help of AlvinBlox's video: PET INVENTORY & EQUIPPING PETS!. and i ran into this issue that I don't know how to solve.
ERROR: Unable to create an instance of the type "AliginPosition"
Script:
local function equipPet(player,pet)
local character = player.Character
if pet ~= nil and character ~= nil then
if character:FindFirstChild(player.Name.."'s Pet") then character[player.Name.."'s Pet"]:Destroy() end
pet.Name = player.Name.."'s Pet"
pet:setPrimaryPartCFrame(character.HumanoidRootPart.CFrame)
local modelSize = pet.PrimaryPart.Size
local attachementCharacter = Instance.new("Attachment")
attachementCharacter.Visible = false
attachementCharacter.Parent = character.HumanoidRootPart
attachementCharacter.Position = Vector3.new(1,1,0) + modelSize
local attachmentPet = Instance.new("Attachment")
attachmentPet.Visible = false
attachmentPet.Parent = pet.PrimaryPart
local alignPosition = Instance.new("AliginPosition")
alignPosition.MaxForce = 25000
alignPosition.Attachment0 = attachmentPet
alignPosition.Attachment1 = attachementCharacter
alignPosition.Responsiveness = 25
alignPosition.Parent = pet
pet.Parent = character
end
end
