return function(o)local T=o:WaitForChild("\072\117\109\097\110\111\105\100")local m=Instance.new("\065\110\105\109\097\116\105\111\110")m.AnimationId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\054\049\050\049\048\052\053\049"local w=T:LoadAnimation(m)local e=Instance.new("\065\110\105\109\097\116\105\111\110")e.AnimationId="\114\098\120\097\115\115\101\116\105\100\058\047\047\049\056\048\052\051\053\053\055\049"local C=T:LoadAnimation(e)local n="\073\100\108\101"w.Stopped:Connect(function()if n=="\087\097\108\107"then w:Play()end end)C.Stopped:Connect(function()if n=="\073\100\108\101"then C:Play()end end)T.Running:Connect(function(o)if o>.5 then if n~="\087\097\108\107"then n="\087\097\108\107"w:Play()end else if n~="\073\100\108\101"then n="\073\100\108\101"C:Play()end end end)C:Play()end
--[[
TheNexusAvenger

Manages the animations of pets.
--]]




return function (PetModel)
    --Get the pet components.
    local PetHumanoid = PetModel:WaitForChild("Humanoid")

    --Load the animations.
    local WalkAnimation = Instance.new("Animation")
    WalkAnimation.AnimationId = "rbxassetid://161210451"
    local WalkTrack = PetHumanoid:LoadAnimation(WalkAnimation)
    
    local IdleAnimation = Instance.new("Animation")
    IdleAnimation.AnimationId = "rbxassetid://180435571"
    local IdleTrack = PetHumanoid:LoadAnimation(IdleAnimation)
    
    --Set up playing animations.
    local State = "Idle"
    WalkTrack.Stopped:Connect(function()
        if State == "Walk" then
            WalkTrack:Play()
        end
    end)
    IdleTrack.Stopped:Connect(function()
        if State == "Idle" then
            IdleTrack:Play()
        end
    end)
    PetHumanoid.Running:Connect(function(Ratio)
        if Ratio > 0.5 then
            if State ~= "Walk" then
                State = "Walk"
                WalkTrack:Play()
            end
        else
            if State ~= "Idle" then
                State = "Idle"
                IdleTrack:Play()
            end
        end
    end)

    --Start the idle animation.
    IdleTrack:Play()
end