local variable = script.Parent:WaitForChild("ClickDetector")
variable.MouseClick:Connect(function(p)
    if p.Character then
        for _,v in next,p.Character:GetChildren() do
            if v:IsA("Hat") then
                v.Part.Mesh.VertexColor = Vector3.new(1,1,1)
            end
        end
    end
end)