local W=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local w=W:WaitForChild("\099\111\109\109\111\110")local Z=require(w:WaitForChild("\065\115\115\101\116\115"))local d=require(script.Parent.PetRenderer)local a=require(w.util:WaitForChild("\103\101\116\065\115\115\101\116\077\111\100\101\108"))local p=4 local o=setmetatable({},{__index=d})local function c(W)local w=(a(W)):Clone()w.CanCollide=false w.Anchored=true w.Locked=true return w end function o.new(W,w,Z)local a=setmetatable(d.new(W,w,Z),{__index=o})return a end function o.update(w,W)d.update(w,W)local Z=w.viewModel if not Z then return end local a=Z:FindFirstChild("\077\101\115\104")local o=(tick()/3)%1 local c=Color3.fromHSV(o,.7,1)Z.Color=c if a then a.VertexColor=Vector3.new(c.R*p,c.G*p,c.B*p)end end return o
-- object based pets renderer, default renderer for pets.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local common = ReplicatedStorage:WaitForChild("common")
local Assets = require(common:WaitForChild("Assets"))
local PetRenderer = require(script.Parent.PetRenderer)

local getAssetModel = require(common.util:WaitForChild("getAssetModel"))

local RAINBOW_INTENSITY = 4

local RainbowPetRenderer = setmetatable({},{__index = PetRenderer})

local function createModel(assetId)
    local newModel = getAssetModel(assetId):Clone()

    newModel.CanCollide = false
    newModel.Anchored = true
    newModel.Locked = true

    return newModel
end

function RainbowPetRenderer.new(assetId,rig, client)
    -- create hat for this rig
    local self = setmetatable(PetRenderer.new(assetId,rig,client),{__index = RainbowPetRenderer})

    return self
end

function RainbowPetRenderer:update(client)
    PetRenderer.update(self,client)

    local viewModel = self.viewModel
    if not viewModel then return end
    local mesh = viewModel:FindFirstChild("Mesh")

    local now = (tick()/3)%1
    local newColor = Color3.fromHSV(now,0.7,1)

    viewModel.Color = newColor

    if mesh then
        mesh.VertexColor = Vector3.new(
            newColor.R*RAINBOW_INTENSITY,
            newColor.G*RAINBOW_INTENSITY,
            newColor.B*RAINBOW_INTENSITY
        )
    end
end

return RainbowPetRenderer