how can i edit this to make it so the pet walks and does not fly:
>local rs = game:GetService("ReplicatedStorage")
local config = require(rs:WaitForChild("CONFIGURATION"))
function createFunc(plr:Player, equippedValue:ObjectValue)
if plr and equippedValue.Parent == plr.PetsEquipped and equippedValue.Value ~= nil then
local char = plr.Character
if char and char.Humanoid.Health > 0 then
local petToCreate = equippedValue.Value
local newPet = petToCreate:Clone()
local primaryPart = newPet.PrimaryPart or newPet:WaitForChild("Base")
newPet.PrimaryPart = primaryPart
newPet:PivotTo(char.HumanoidRootPart.CFrame)
for _, part in pairs(newPet:GetDescendants()) do
if part:IsA("BasePart") then
part.Anchored = false
part.CanCollide = false
if part ~= primaryPart then
local wc = Instance.new("WeldConstraint")
wc.Part0 = primaryPart
wc.Part1 = part
wc.Parent = part
end
end
end
local atch0 = Instance.new("Attachment")
atch0.Name = "Attachment0"
atch0.Parent = primaryPart
local ap = Instance.new("AlignPosition")
ap.MaxForce = math.huge
ap.MaxVelocity = 20
ap.Mode = Enum.PositionAlignmentMode.OneAttachment
ap.Attachment0 = atch0
ap.Position = char.HumanoidRootPart.Position
ap.Parent = primaryPart
local ao = Instance.new("AlignOrientation")
ao.MaxTorque = math.huge
ao.Mode = Enum.OrientationAlignmentMode.OneAttachment
ao.Attachment0 = atch0
ao.CFrame = char.HumanoidRootPart.CFrame
ao.Parent = primaryPart
equippedValue["LINKED PET"].Value = newPet
newPet.Parent = char:WaitForChild("EQUIPPED PETS")
repeat game:GetService("RunService").Heartbeat:Wait() until primaryPart.Parent.Parent == char["EQUIPPED PETS"]
primaryPart:SetNetworkOwner(plr)
end
end
end
return createFunc