llocal function equipPet(player,pet)
local character = player.Character--problem is here
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.CFrame
local attachmentCharacter = Instance.new("Attachment")
attachmentCharacter.Visible = false
attachmentCharacter.Parent = character.HumanoiRootPart
attachmentCharacter.Position = Vector3.new(1,1,0) + modelSize
local attachmentPet = Instance.new("Attachment")
attachmentPet.Visible = false
attachmentPet.Parent = pet
local alignPosition = Instance.new("AlignPosition")
alignPosition.MaxForce = 25000
alignPosition.Attachment0 = attachmentPet
alignPosition.Attachment1 = attachmentCharacter
alignPosition.Responsiveness = 25
alignPosition.Parent = pet
pet.Parent = character
end
end
It says that problem is Character is not a valid member of a model

1 comment
Itells me that CharacterAdded is not a valid member of Model